]>
Commit | Line | Data |
---|---|---|
10cdb5dc AM |
1 | This fixes issues with the server choking when it's listening to acpid and |
2 | acpid is shut down. See https://bugs.freedesktop.org/show_bug.cgi?id=5140 | |
3 | and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=345537. | |
4 | ||
5 | This patch by Mattia Dongili. | |
6 | ||
7 | Index: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_acpi.c | |
8 | =================================================================== | |
9 | RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_acpi.c,v | |
10 | retrieving revision 1.2 | |
11 | diff -u -r1.2 lnx_acpi.c | |
12 | --- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_acpi.c 31 Oct 2005 05:45:40 -0000 1.2 | |
13 | +++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_acpi.c 2 Jan 2006 17:17:29 -0000 | |
14 | @@ -45,6 +45,13 @@ | |
15 | memset(ev, 0, LINE_LENGTH); | |
16 | ||
17 | n = read( fd, ev, LINE_LENGTH ); | |
18 | + if (n <= 0) { | |
19 | + /* can only happen when reading from acpid socket */ | |
20 | + xf86MsgVerb(X_WARNING,3,"ACPI Event handler disappeared, reopening.\n"); | |
21 | + lnxCloseACPI(); | |
22 | + lnxACPIOpen(); | |
23 | + return 0; | |
24 | + } | |
25 | ||
26 | /* Check that we have a video event */ | |
27 | if (strstr(ev, "video") == ev) { | |
28 | @@ -160,6 +167,9 @@ | |
29 | #ifdef DEBUG | |
30 | ErrorF("ACPI: Closing device\n"); | |
31 | #endif | |
32 | + xf86PMGetEventFromOs = NULL; | |
33 | + xf86PMConfirmEventToOs = NULL; | |
34 | + | |
35 | if (ACPIihPtr) { | |
36 | fd = xf86RemoveInputHandler(ACPIihPtr); | |
37 | shutdown(fd, 2); |