[Git][cmucl/cmucl][master] Clean up prog_status

Raymond Toy rtoy at common-lisp.net
Sat Sep 16 21:50:58 UTC 2017


Raymond Toy pushed to branch master at cmucl / cmucl


Commits:
81e08ecb by Raymond Toy at 2017-09-16T14:49:33-07:00
Clean up prog_status

 - If `waidpid` returns 0 or -1, we should return.
 - Make the fprintf message a bit clearer on what's happening when we
   have some kind of status that we didn't handle.

- - - - -


1 changed file:

- src/lisp/runprog.c


Changes:

=====================================
src/lisp/runprog.c
=====================================
--- a/src/lisp/runprog.c
+++ b/src/lisp/runprog.c
@@ -107,8 +107,7 @@ prog_status(pid_t* pid, int* what, int* code, int* corep)
     w = waitpid(-1, &status, WNOHANG | WUNTRACED | WCONTINUED);
     *pid = w;
 
-    if (w == -1) {
-        
+    if (w <= 0) {
         return;
     }
 
@@ -129,7 +128,7 @@ prog_status(pid_t* pid, int* what, int* code, int* corep)
         *code = 0;
         *corep = 0;
     } else {
-        fprintf(stderr, "pid = %d, status = 0x%x\n", *pid, status);
+        fprintf(stderr, "Unhandled waidpid status: pid = %d, status = 0x%x\n", *pid, status);
     }
 
     return;



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/81e08ecbdbbafb9ee29a4013bb3a3a1f25c70118

---
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/81e08ecbdbbafb9ee29a4013bb3a3a1f25c70118
You're receiving this email because of your account on gitlab.common-lisp.net.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20170916/3733914a/attachment.html>


More information about the cmucl-cvs mailing list