From e169648b89840b0e5d4dc3a165f4182caca396f5 Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 19 Sep 2010 19:28:23 +0000 Subject: [PATCH] while here, change SETUID_CAN_FAIL_WITH_EAGAIN to abort immediately by suggestion of Chris Palmer again --- check.t | 4 ++-- misc.c | 16 ++++------------ sh.h | 4 ++-- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/check.t b/check.t index 1442ba7..8b31b34 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.393 2010/09/15 21:08:16 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.394 2010/09/19 19:28:21 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 $ @@ -25,7 +25,7 @@ # http://www.research.att.com/~gsf/public/ifs.sh expected-stdout: - @(#)MIRBSD KSH R39 2010/09/15 + @(#)MIRBSD KSH R39 2010/09/19 description: Check version of shell. stdin: diff --git a/misc.c b/misc.c index 4d057e0..6efda16 100644 --- a/misc.c +++ b/misc.c @@ -29,7 +29,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.147 2010/09/14 21:26:15 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.148 2010/09/19 19:28:22 tg Exp $"); unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */ @@ -48,17 +48,9 @@ static void chvt(const char *); #ifdef SETUID_CAN_FAIL_WITH_EAGAIN /* we don't need to check for other codes, EPERM won't happen */ #define DO_SETUID(func, argvec) do { \ - bool messaged = false; \ - \ - while (/* CONSTCOND */ 1) \ - if (!(func argvec) || errno != EAGAIN) \ - break; \ - else if (!messaged) { \ - warningf(true, "%s failed with EAGAIN," \ - " probably due to a too low process" \ - " limit; retrying infinitely", #func); \ - messaged = true; \ - } \ + if ((func argvec) && errno == EAGAIN) \ + errorf("%s failed with EAGAIN, probably due to a" \ + " too low process limit; aborting", #func); \ } while (/* CONSTCOND */ 0) #else #define DO_SETUID(func, argvec) func argvec diff --git a/sh.h b/sh.h index 2b6f238..08a0e72 100644 --- a/sh.h +++ b/sh.h @@ -154,9 +154,9 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.415 2010/09/15 21:08:19 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.416 2010/09/19 19:28:23 tg Exp $"); #endif -#define MKSH_VERSION "R39 2010/09/15" +#define MKSH_VERSION "R39 2010/09/19" #ifndef MKSH_INCLUDES_ONLY