I have an Xlib program which does the following :-
int Signal = 0;
void SignalHandler();
main()
{
switch( fork() )
{
case 0:
signal( SIGUSR1,SignalHandler );
XOpenDisplay( display );
...
XMapWindow(...);
do
{
XNextEvent( display,report );
...
}
while ( Signal==0 );
XUnmapWindow(..);
...
XCloseDisplay(...);
}
voidQuote:}
SignalHandler()
{
Signal = 1;
So what happens I would like to happen is that the forked processQuote:}
should exit "nicely" upon receipt of the signal but it gets stuck in the
XNextEvent call until it receives an event at which time it exits.
Can anyone tell me how to get it to exit immediately ?
I tried using XCheckWindowEvent instead of XNextEvent but continually
going through the while loop is rather hungry on cpu time !!
Please Reply by email
Thanks in advance
Simon Oldfield