diff options
author | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
commit | 81f91c615982e50bb62708201569c33a3cd3d973 (patch) | |
tree | 4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c | |
parent | b571a562410f565af2bdde52d9f7f9a23ffae04f (diff) | |
parent | a915739887477b28d924ecc8417ee107d125bd6c (diff) | |
download | vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2 vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip |
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c')
-rw-r--r-- | xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c b/xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c index bb975cc5d..5fad19451 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c @@ -133,23 +133,22 @@ lnxACPIOpen(void) int fd; struct sockaddr_un addr; int r = -1; + static int warned = 0; -#ifdef DEBUG - ErrorF("ACPI: OSPMOpen called\n"); -#endif + DebugF("ACPI: OSPMOpen called\n"); if (ACPIihPtr || !xf86Info.pmFlag) return NULL; -#ifdef DEBUG - ErrorF("ACPI: Opening device\n"); -#endif + DebugF("ACPI: Opening device\n"); if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) > -1) { memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; strcpy(addr.sun_path, ACPI_SOCKET); if ((r = connect(fd, (struct sockaddr*)&addr, sizeof(addr))) == -1) { - xf86MsgVerb(X_WARNING,3,"Open ACPI failed (%s) (%s)\n", ACPI_SOCKET, - strerror(errno)); + if (!warned) + xf86MsgVerb(X_WARNING,3,"Open ACPI failed (%s) (%s)\n", + ACPI_SOCKET, strerror(errno)); + warned = 1; shutdown(fd, 2); close(fd); return NULL; @@ -160,6 +159,7 @@ lnxACPIOpen(void) xf86PMConfirmEventToOs = lnxACPIConfirmEventToOs; ACPIihPtr = xf86AddGeneralHandler(fd,xf86HandlePMEvents,NULL); xf86MsgVerb(X_INFO,3,"Open ACPI successful (%s)\n", ACPI_SOCKET); + warned = 0; return lnxCloseACPI; } @@ -168,10 +168,8 @@ static void lnxCloseACPI(void) { int fd; - -#ifdef DEBUG - ErrorF("ACPI: Closing device\n"); -#endif + + DebugF("ACPI: Closing device\n"); if (ACPIihPtr) { fd = xf86RemoveGeneralHandler(ACPIihPtr); shutdown(fd, 2); |