Fix fd leak by closing them in the ACPI code instead of just using

shutdown.
This commit is contained in:
Kevin E Martin 2005-10-31 05:45:40 +00:00
parent 7993486e80
commit 56101c9d6e

View File

@ -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;
}
}