summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2008-10-11 02:10:48 +0200
committerJulien Cristau <jcristau@debian.org>2008-10-11 02:16:25 +0200
commit847eac826286e6202f42b9a2ccc160a232a710a3 (patch)
treed9906cf4d749653d85e065d315e7602fd00dff08
parenta196672a6bafd4e7d3a2cca991a2a3bf4bdcd952 (diff)
Set pInfo->fd to -1 on DEVICE_CLOSE
This allows the reopen logic to kick in later. DEVICE_CLOSE gets called on regen, so without this we'd keep a stale file descriptor in pInfo->fd in subsequent sessions. Debian bug#496101 (http://bugs.debian.org/496101)
-rw-r--r--src/evdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index a7f4f23..1c2a559 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1060,8 +1060,10 @@ EvdevProc(DeviceIntPtr device, int what)
case DEVICE_CLOSE:
xf86Msg(X_INFO, "%s: Close\n", pInfo->name);
- if (pInfo->fd != -1)
+ if (pInfo->fd != -1) {
close(pInfo->fd);
+ pInfo->fd = -1;
+ }
break;
}