Path: utzoo!attcan!uunet!bloom-beacon!watson.ibm.COM!dan From: dan@watson.ibm.COM (Walt Daniels) Newsgroups: comp.windows.x Subject: XIOErrorHandler Message-ID: <100689.093908.dan@watson.ibm.com> Date: 6 Oct 89 13:39:08 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 27 Submitting for a friend (Walt) Is this an IBM problem, or is it a genetic defect? ------------ I'm installing an XIOErrorHandler so that my application can do some reasonable clean-up and shutdown if the connection to the window fails. (I'm running AIX/RT - latest updates to X) My XIOErrorHandler gets control just fine when I run the client on one node and the server on another and I kill the server. But if I run the client and server on the same machine and I kill the server (or cancel the window), the default AIX SIGPIPE signal handler gets control, prints "Broken pipe" and then exits. My handler never gets called. The reason why this happens is that Xlib is writing to a pipe, and if the pipe gets broken, the AIX SIGPIPE handler gets control and never gives Xlib the chance to check the error code from the write and invoke the XIOErrorHandler. I really think that Xlib should do something with SIGPIPE signals other than letting the default action take place. This would allow the XIOErrorHandler (Xlib's default, or user specified) to get invoked. I can get around the problem by saying "signal(SIGPIPE, SIG_IGN);" in my application, but I think this call should be in Xlib. I'm not totally sure why it worked for the remote case. But I would guess that TCP/IP (or whatever the transport mechanism is for remote pipes) is handling SIGPIPE. Karl Schultz Engineering Graphics Products