From 0802db49a40586f24db70a95d27500e2845f1eda Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sat, 18 Jul 2015 14:12:23 +0200 Subject: Fix default output redirections to ignore stderr. This is what scsh does as well, and is more like a regular UNIX shell. Thanks to Haochi Kiang for reporting the bug and providing a patch. --- scsh-process.scm | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'scsh-process.scm') diff --git a/scsh-process.scm b/scsh-process.scm index d7ffaf0..a741177 100644 --- a/scsh-process.scm +++ b/scsh-process.scm @@ -11,7 +11,7 @@ ;; WARNING: Don't mix with threading unless you're using ;; Chicken 4.8.1 rev 47b5be71 or later. ;; -;;; Copyright (c) 2012-2013, Peter Bex +;;; Copyright (c) 2012-2015, Peter Bex ;; All rights reserved. ; ; Redistribution and use in source and binary forms, with or without @@ -247,10 +247,7 @@ (lambda () (file-close in) (duplicate-fileno out 1) - (duplicate-fileno out 2) - (with-output-to-port (open-output-file* out) - (lambda () - (with-error-output-to-port (open-output-file* out) thunk))))))) + (with-output-to-port (open-output-file* out) thunk))))) (file-close out) (open-input-file* in))) @@ -260,10 +257,7 @@ (fork/pipe (lambda () (let ((fd (file-open temp-file open/wronly))) (duplicate-fileno fd 1) - (duplicate-fileno fd 2) - (with-output-to-port (open-output-file* 1) - (lambda () - (with-error-output-to-port (open-output-file* 2) thunk))))))) + (with-output-to-port (open-output-file* 1) thunk))))) temp-file)) (define (run/string* thunk) @@ -368,7 +362,7 @@ ;; with the generic one if we happen to make a small mistake (syntax-rules (pipe pipe+ begin epf) ((_ (pipe ?pf0 ...) ?redir0 ...) - (exec-epf (pipe+ ((1 2 0)) ?pf0 ...) ?redir0 ...)) + (exec-epf (pipe+ ((1 0)) ?pf0 ...) ?redir0 ...)) ((_ (pipe+ ?args ...) ?redir0 ...) (let-syntax ((pipe+ -- cgit v1.2.3