From 4ddd8202bc49c02b34ff2dc662976dbf8aa9eb03 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 18 Aug 2000 05:10:45 +0000 Subject: lad_dealloc(): if xp->x_fd == -1, it means the descriptor's already been closed. Don't try to reclose it. Found by Insure. --- Modules/linuxaudiodev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 @@ newladobject(PyObject *arg) 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); } -- cgit v0.12