Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!mcsun!inria!peake From: peake@inria.inria.fr (Philip Peake) Newsgroups: comp.windows.x Subject: Re: xperfmon under SunOS 4.0.X Message-ID: <1436@inria.inria.fr> Date: 5 Dec 89 13:09:48 GMT References: <8911230421.AA02003@poseur.jpl.nasa.gov> Organization: Cetia, Toulon, France. Lines: 23 earle@POSEUR.JPL.NASA.GOV (Greg Earle) writes: > On a totally unrelated note, I have found that `xperfmon' (with the > aforementioned patch installed) becomes The Program That Wouldn't Die. I've noticed this on our copy. It seems that when the other end of the connection is closed, xperfmon's select() shows the X connection as having something to read (the eof), but it calls XPending() to look for an event, and since this does a ioctl(,FIONREAD,) it finds 0 bytes on the file descriptor, and so goes round the loop again, having done nothing. There are several possible solutions. I just added the following to main_event_loop() in xperfmon.c inside the block after else if (nfound > 0) long num = 0; ioctl (display_fd, FIONREAD, &num); if(num==0)exit(1); You probably need to #include -------------- Mark M Martin mmm@cetia.uucp Cetia, Toulon, France mmm@inria!cetia