Module Name: src Committed By: christos Date: Sat Jan 21 23:03:36 UTC 2017
Modified Files: src/bin/sh: redir.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/bin/sh/redir.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/bin/sh/redir.c diff -u src/bin/sh/redir.c:1.48 src/bin/sh/redir.c:1.49 --- src/bin/sh/redir.c:1.48 Tue Jan 10 15:43:08 2017 +++ src/bin/sh/redir.c Sat Jan 21 18:03:36 2017 @@ -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 @@ openredirect(union node *redir, char mem 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