unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* slib system
@ 2004-01-06 23:56 Kevin Ryde
  2004-01-10 23:41 ` Marius Vollmer
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2004-01-06 23:56 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

The core `system' returns a wait style exit status value, but slib
says system there should be a plain integer exit code like 0, 1, 2,
etc.

        * slib.scm (system): New function, giving an exit code return in
        accordance with slib spec.

This would be a bug fix for the 1.6 branch too.


[-- Attachment #2: slib.scm.system.diff --]
[-- Type: text/plain, Size: 811 bytes --]

--- slib.scm.~1.41.~	2004-01-04 07:14:41.000000000 +1000
+++ slib.scm	2004-01-07 09:52:19.000000000 +1000
@@ -246,6 +246,27 @@
 (define >?  >)
 (define >=? >=)
 
+;;; {system}
+;;;
+
+;; If the program run is killed by a signal, the shell normally gives an
+;; exit code of 128+signum.  If the shell itself is killed by a signal then
+;; we do the same 128+signum here.
+;;
+;; "stop-sig" shouldn't arise here, since system shouldn't be calling
+;; waitpid with WUNTRACED, but allow for it anyway, just in case.
+;;
+(if (defined? 'system)
+    (define-public system
+      (let ((core-system system))
+	(lambda (str)
+	  (let ((st (core-system str)))
+	    (cond ((status:exit-val st)
+		   => noop)
+		  (else
+		   (+ 128 (or (status:term-sig st)
+			      (status:stop-sig st))))))))))
+
 ;;; {Time}
 ;;;
 

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-01-10 23:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-06 23:56 slib system Kevin Ryde
2004-01-10 23:41 ` Marius Vollmer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).