summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1996-04-29 13:19:50 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1996-04-29 13:19:50 +0000
commit4864fecc59ebadb53e33dc4adcfd8d7f282c256a (patch)
treeaefab30942d24e6b883f6e1ab3fd907c2fdb09eb
parent8c3bf593c4790c47cf6dbf51a9e4b79e3e88710d (diff)
Utilisation de sigaction au lieu de signal si POSIX_SIGNALS.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@765 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--otherlibs/graph/events.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/otherlibs/graph/events.c b/otherlibs/graph/events.c
index c82a7461f..ed4d9fbab 100644
--- a/otherlibs/graph/events.c
+++ b/otherlibs/graph/events.c
@@ -41,7 +41,11 @@ value gr_wait_event(eventlist)
Window rootwin, childwin;
int root_x, root_y, win_x, win_y;
unsigned int modifiers;
+#ifdef POSIX_SIGNALS
+ struct sigaction sigact, oldsig;
+#else
void (*oldsig)();
+#endif
XEvent event;
mask = 0;
@@ -82,7 +86,12 @@ value gr_wait_event(eventlist)
gr_head++;
if (gr_head >= SIZE_QUEUE) gr_head = 0;
} else {
+#ifdef POSIX_SIGNALS
+ sigact.sa_handler = SIG_IGN;
+ sigaction(EVENT_SIGNAL, &sigact, &oldsig);
+#else
oldsig = signal(EVENT_SIGNAL, SIG_IGN);
+#endif
XSelectInput(grdisplay, grwindow.win, DEFAULT_EVENT_MASK | mask);
again:
XNextEvent(grdisplay, &event);
@@ -112,7 +121,11 @@ value gr_wait_event(eventlist)
gr_handle_simple_event(&event);
goto again;
}
+#ifdef POSIX_SIGNALS
+ sigaction(EVENT_SIGNAL, &oldsig, NULL);
+#else
signal(EVENT_SIGNAL, oldsig);
+#endif
XSelectInput(grdisplay, grwindow.win, DEFAULT_EVENT_MASK);
XFlush(grdisplay);
}