summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin E Martin <kem@kem.org>2005-10-31 05:45:40 +0000
committerKevin E Martin <kem@kem.org>2005-10-31 05:45:40 +0000
commit56101c9d6ec3585a0a8550da4b83dd399e3bcce6 (patch)
treee983ae3b25a58350501adc699ae03e2e1d8a6f6d
parent7993486e80711bd6f6f5b6c2b1f2ac32bfba735b (diff)
Fix fd leak by closing them in the ACPI code instead of just using
shutdown.
-rw-r--r--hw/xfree86/os-support/linux/lnx_acpi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c
index c806b4526..9d1dea77d 100644
--- a/hw/xfree86/os-support/linux/lnx_acpi.c
+++ b/hw/xfree86/os-support/linux/lnx_acpi.c
@@ -130,6 +130,7 @@ lnxACPIOpen(void)
strcpy(addr.sun_path, ACPI_SOCKET);
if ((r = connect(fd, (struct sockaddr*)&addr, sizeof(addr))) == -1) {
shutdown(fd, 2);
+ close(fd);
fd = -1;
}
}
@@ -162,6 +163,7 @@ lnxCloseACPI(void)
if (ACPIihPtr) {
fd = xf86RemoveInputHandler(ACPIihPtr);
shutdown(fd, 2);
+ close(fd);
ACPIihPtr = NULL;
}
}