Source-Changes-HG archive

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

[src/trunk]: src/bin/sh Don't let set cloexec for "exec n>&1" like ksh does (...



details:   https://anonhg.NetBSD.org/src/rev/8823965474be
branches:  trunk
changeset: 821046:8823965474be
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 21 23:03:36 2017 +0000

description:
Don't let set cloexec for "exec n>&1" like ksh does (but not bash). Unit
tests pass... If we don't like that, we should add some unittests that fail.

diffstat:

 bin/sh/redir.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 016a768a4009 -r 8823965474be bin/sh/redir.c
--- a/bin/sh/redir.c    Sat Jan 21 22:54:11 2017 +0000
+++ b/bin/sh/redir.c    Sat Jan 21 23:03:36 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: redir.c,v 1.48 2017/01/10 20:43:08 christos Exp $      */
+/*     $NetBSD: redir.c,v 1.49 2017/01/21 23:03:36 christos Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)redir.c    8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: redir.c,v 1.48 2017/01/10 20:43:08 christos Exp $");
+__RCSID("$NetBSD: redir.c,v 1.49 2017/01/21 23:03:36 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -306,7 +306,7 @@
                            memory[redir->ndup.dupfd])
                                memory[fd] = 1;
                        else if (copyfd(redir->ndup.dupfd, fd,
-                           (flags&(REDIR_PUSH|REDIR_KEEP)) == REDIR_PUSH) < 0)
+                           (flags & REDIR_KEEP) == 0) < 0)
                                error("Redirect (from %d to %d) failed: %s",
                                    redir->ndup.dupfd, fd, strerror(errno));
                } else



Home | Main Index | Thread Index | Old Index