[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

p_exec wait error (SIGCHLD handler vs system()...)



this should make the combination system() (Pexec 0) + SIGCHLD handler
work better...  (who is doing that??  you guessed it, tin...)

Index: dosmem.c
@@ -721,7 +721,7 @@
 
 		newpid = p->pid;
 		for(;;) {
-			r = p_wait3(0, (long *)0);
+			r = p_waitpid(curproc->pid ? newpid : -1, 0, (long *)0);
 			if (r < 0) {
 				ALERT("p_exec: wait error");
 				return EINTRN;
Index: proc.c
@@ -14,7 +14,7 @@
 #include "mint.h"
 #include "xbra.h"
 
-static void do_wakeup_things P_((short sr, int newslice));
+static void do_wakeup_things P_((short sr, int newslice, long cond));
 INLINE static void do_wake P_((int que, long cond));
 
 extern short proc_clock;
@@ -438,9 +438,10 @@
  */
 
 INLINE static void
-do_wakeup_things(sr, newslice)
+do_wakeup_things(sr, newslice, cond)
 short sr;
 int newslice;
+long cond;
 {
 /*
  * check for stack underflow, just in case
@@ -472,7 +473,7 @@
  */
 
 		checkalarms();
-		if (p->sigpending)
+		if (p->sigpending && cond != (long)p_waitpid)
 			check_sigs();		/* check for signals */
 	}
 
@@ -555,7 +556,7 @@
 /* we're just going to wake up again right away! */
 		iwakecond = 0;
 		spl(sr);
-		do_wakeup_things(sr, newslice);
+		do_wakeup_things(sr, newslice, cond);
 		return (onsigs != curproc->nsigs);
 	}
 
@@ -638,7 +639,7 @@
 			*((void **)0x44eL) = curproc->logbase;
 #endif
 #endif
-		do_wakeup_things(sr, 1);
+		do_wakeup_things(sr, 1, cond);
 		return (onsigs != curproc->nsigs);
 	}
 /*

oh and here is another little bug...

Index: tty.c
@@ -675,7 +675,7 @@
 		r = (*f->dev->ioctl)(f, TIOCFLUSH, (void *)arg);
 		if (r || (f->flags & O_HEAD))
 			return r;
-		if (!arg || (*(int *)arg & 1))
+		if (!arg || (*(long *)arg & 1))
 			tty->state &= ~TS_ESC;
 		return 0;
 	    }

 cheers
	Juergen  (noo i still prefer a _real_ threaded newsreader... :)
-- 
J"urgen Lock / nox@jelal.hb.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
								...ohne Gewehr
PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA