commit | 4ddd8202bc49c02b34ff2dc662976dbf8aa9eb03 | [log] [tgz] |
---|---|---|
author | Barry Warsaw <barry@python.org> | Fri Aug 18 05:10:45 2000 +0000 |
committer | Barry Warsaw <barry@python.org> | Fri Aug 18 05:10:45 2000 +0000 |
tree | ade78c53dce644c4909016ad09e920cf1392f1a6 | |
parent | 152fbe88e9fd661c195b2374a0d229998e18e8dc [diff] |
lad_dealloc(): if xp->x_fd == -1, it means the descriptor's already been closed. Don't try to reclose it. Found by Insure.
diff --git a/Modules/linuxaudiodev.c b/Modules/linuxaudiodev.c index b0677ef..5bcbaf2 100644 --- a/Modules/linuxaudiodev.c +++ b/Modules/linuxaudiodev.c
@@ -110,7 +110,9 @@ static void lad_dealloc(lad_t *xp) { - close(xp->x_fd); + /* if already closed, don't reclose it */ + if (xp->x_fd != -1) + close(xp->x_fd); PyObject_Del(xp); }