From 56101c9d6ec3585a0a8550da4b83dd399e3bcce6 Mon Sep 17 00:00:00 2001 From: Kevin E Martin Date: Mon, 31 Oct 2005 05:45:40 +0000 Subject: [PATCH] Fix fd leak by closing them in the ACPI code instead of just using shutdown. --- hw/xfree86/os-support/linux/lnx_acpi.c | 2 ++ 1 file changed, 2 insertions(+) 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; } }