From 2621715a17804c00ef6307694e704aec5224667a Mon Sep 17 00:00:00 2001 From: tg Date: Mon, 25 Jun 2012 16:34:58 +0000 Subject: [PATCH] =?UTF-8?q?fix=20two=20inverse=20logic=20mistakes=20(I?= =?UTF-8?q?=E2=80=99m=20apparently=20r=CC=B2e=CC=B2a=CC=B2l=CC=B2l=CC=B2y?= =?UTF-8?q?=CC=B2=20fond=20of=20them=E2=80=A6=20=E2=98=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check.t | 21 +++++++++++++++++---- funcs.c | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/check.t b/check.t index e5f8ebd..0b749c2 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.541 2012/06/25 16:31:16 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.542 2012/06/25 16:34:56 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -4163,9 +4163,9 @@ stdin: set -- `false` echo rv=$? expected-stdout: - FPOSIX=0 FSH=0 rv=0 - FPOSIX=0 FSH=1 rv=0 - FPOSIX=1 FSH=0 rv=0 + FPOSIX=0 FSH=0 rv=1 + FPOSIX=0 FSH=1 rv=1 + FPOSIX=1 FSH=0 rv=1 --- name: regression-11 description: @@ -8232,6 +8232,7 @@ name: fd-cloexec-1 description: Verify that file descriptors > 2 are private for Korn shells AT&T ksh93 does this still, which means we must keep it as well +category: shell:legacy-no file-setup: file 644 "test.sh" echo >&3 Fowl stdin: @@ -8254,6 +8255,18 @@ stdin: expected-stdout: Fowl --- +name: fd-cloexec-3 +description: + Verify that file descriptors > 2 are not private for LEGACY KSH +category: shell:legacy-yes +file-setup: file 644 "test.sh" + echo >&3 Fowl +stdin: + exec 3>&1 + "$__progname" test.sh +expected-stdout: + Fowl +--- name: comsub-1a description: COMSUB are now parsed recursively, so this works diff --git a/funcs.c b/funcs.c index efe754f..efa461b 100644 --- a/funcs.c +++ b/funcs.c @@ -38,7 +38,7 @@ #endif #endif -__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.221 2012/06/25 16:17:54 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.222 2012/06/25 16:34:58 tg Exp $"); #if HAVE_KILLPG /* @@ -2616,7 +2616,7 @@ c_exec(const char **wp MKSH_A_UNUSED) for (i = 0; i < NUFILE; i++) { if (e->savefd[i] > 0) close(e->savefd[i]); -#ifdef MKSH_LEGACY_MODE +#ifndef MKSH_LEGACY_MODE /* * keep all file descriptors > 2 private for ksh, * but not for POSIX or legacy/kludge sh