Fix fd leak by closing them in the ACPI code instead of just using
shutdown.
This commit is contained in:
parent
7993486e80
commit
56101c9d6e
@ -130,6 +130,7 @@ lnxACPIOpen(void)
|
|||||||
strcpy(addr.sun_path, ACPI_SOCKET);
|
strcpy(addr.sun_path, ACPI_SOCKET);
|
||||||
if ((r = connect(fd, (struct sockaddr*)&addr, sizeof(addr))) == -1) {
|
if ((r = connect(fd, (struct sockaddr*)&addr, sizeof(addr))) == -1) {
|
||||||
shutdown(fd, 2);
|
shutdown(fd, 2);
|
||||||
|
close(fd);
|
||||||
fd = -1;
|
fd = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -162,6 +163,7 @@ lnxCloseACPI(void)
|
|||||||
if (ACPIihPtr) {
|
if (ACPIihPtr) {
|
||||||
fd = xf86RemoveInputHandler(ACPIihPtr);
|
fd = xf86RemoveInputHandler(ACPIihPtr);
|
||||||
shutdown(fd, 2);
|
shutdown(fd, 2);
|
||||||
|
close(fd);
|
||||||
ACPIihPtr = NULL;
|
ACPIihPtr = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user