This is the mail archive of the mailing list for the frysk project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Kill and refresh

On Fri, 2006-07-14 at 14:17 +0200, Mark Wielaard wrote:
> >     I suspect the wait-pid is comming 
> > from the child exiting, rather than it being some how attached.  
> > Consequently, I'm not sure if it should be treated as a bug or wart?
> According to Wait.log() [...]

While investigating this I noticed that errno wasn't saved before
calling log() which seems to make it possible for errno to change before
it is actually used in the next statement. Does the following patch make

2006-07-14  Mark Wielaard  <>

    * cni/Wait.cxx (waitAll): Save errno before calling log().



--- frysk/sys/cni/Wait.cxx      15 Jun 2006 19:23:28 -0000      1.13
+++ frysk/sys/cni/Wait.cxx      14 Jul 2006 12:22:55 -0000
@@ -224,9 +224,10 @@
   int status;
   errno = 0;
   pid_t pid = ::waitpid (wpid, &status, __WALL);
+  int myErrno = errno;
   log (pid, status, errno);
   if (pid <= 0)
-    throwErrno (errno, "waitpid", "process", wpid);
+    throwErrno (myErrno, "waitpid", "process", wpid);
   // Process the result.
   processStatus (pid, status, observer);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]