summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2008-05-19 02:24:17 +0200
committerMatthieu Herrb <matthieu@bluenote.herrb.net>2008-06-19 16:55:25 +0200
commit19c7e9da55646f1f6e05c28cd71865cd8d84e1ff (patch)
treeef5721bb69fa1dd5ca02b8ba0bd36e1b83038c21
parent0a81d476388c51f8aa723400dffc375e112ea97a (diff)
preserve errno around the SIGIO handler
-rw-r--r--hw/xfree86/os-support/shared/sigio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
index c97f50302..f51131c6b 100644
--- a/hw/xfree86/os-support/shared/sigio.c
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -101,6 +101,7 @@ xf86SIGIO (int sig)
int i;
fd_set ready;
struct timeval to;
+ int save_errno = errno; /* do not clobber the global errno */
int r;
ready = xf86SigIOMask;
@@ -117,6 +118,8 @@ xf86SIGIO (int sig)
if (r > 0) {
xf86Msg(X_ERROR, "SIGIO %d descriptors not handled\n", r);
}
+ /* restore global errno */
+ errno = save_errno;
}
static int