From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.lisp.guile.devel Subject: Re: Support for (system '("echo" "foo" "bar")) Date: Fri, 31 Oct 2003 12:05:49 -0500 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87ad7l9i8h.fsf@raven.i.defaultvalue.org> <87u15qpjwk.fsf@zip.com.au> <877k2mgdjs.fsf@raven.i.defaultvalue.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1067620118 26451 80.91.224.253 (31 Oct 2003 17:08:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2003 17:08:38 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Oct 31 18:08:35 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AFclH-0001sH-00 for ; Fri, 31 Oct 2003 18:08:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFcjq-00072n-NZ for guile-devel@m.gmane.org; Fri, 31 Oct 2003 12:07:06 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AFcjb-00071o-Me for guile-devel@gnu.org; Fri, 31 Oct 2003 12:06:51 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AFcj4-0006oi-RN for guile-devel@gnu.org; Fri, 31 Oct 2003 12:06:50 -0500 Original-Received: from [129.22.104.63] (helo=harris.CNS.CWRU.Edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFcj4-0006g9-9g for guile-devel@gnu.org; Fri, 31 Oct 2003 12:06:18 -0500 Original-Received: from conversion-daemon.smtp-a.cwru.edu by smtp-a.cwru.edu (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) id <0HNM00E01SSHCN@smtp-a.cwru.edu> for guile-devel@gnu.org; Fri, 31 Oct 2003 12:05:50 -0500 (EST) Original-Received: from multivac.cwru.edu (multivac.ITS.CWRU.Edu [129.22.114.26]) by smtp-a.cwru.edu (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with SMTP id <0HNM009OPSTQ89@smtp-a.cwru.edu> for guile-devel@gnu.org; Fri, 31 Oct 2003 12:05:50 -0500 (EST) Original-Received: (qmail 11018 invoked by uid 500); Fri, 31 Oct 2003 17:06:12 +0000 In-reply-to: <877k2mgdjs.fsf@raven.i.defaultvalue.org> Original-To: Rob Browning Mail-followup-to: Rob Browning , guile-devel@gnu.org Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) Original-Lines: 47 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2939 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2939 Rob Browning wrote: > { > if (SCM_NULLP (cmds)) > SCM_WRONG_TYPE_ARG (1, cmds); > > if (SCM_CONSP (cmds)) ... > else > SCM_WRONG_TYPE_ARG (1, SCM_CAR (cmds)); This doesn't look right - you're looking at (car cmds) when cmds is not a cons. How about: { if (! SCM_CONSP (cmds)) SCM_WRONG_TYPE_ARG (1, cmds); ... } That should catch the null case too. Or, to get the behavior Kevin described: (define (system* . args) (flush-all-ports) (let* ((p (pipe)) (pid (primitive-fork))) (if (zero? pid) (catch 'system-error (lambda () (close-port (car p)) (fcntl (cdr p) F_SETFD FD_CLOEXEC) (apply execlp (car args) args)) (lambda . exception (write exception (cdr p)) (force-output (cdr p)) (primitive-exit))) (begin (close-port (cdr p)) (let* ((exception (read (car p))) (status (cdr (waitpid pid)))) (close-port (car p)) (if (not (eof-object? exception)) (apply throw exception) status)))))) paul _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel