From 632ddd50a729d47b42a1179f5943f5e815e7cda0 Mon Sep 17 00:00:00 2001 From: tg Date: Mon, 8 Jun 2009 20:52:28 +0000 Subject: [PATCH] Add MKSH_NO_LIMITS, to define which has the same effect as the absence of RLIM_INFINITY, namely make c_ulimit() into a true --- Build.sh | 3 ++- funcs.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Build.sh b/Build.sh index 9de573e..b271868 100644 --- a/Build.sh +++ b/Build.sh @@ -1,5 +1,5 @@ #!/bin/sh -srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.400 2009/06/08 20:34:37 tg Exp $' +srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.401 2009/06/08 20:52:28 tg Stab $' #- # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Thorsten Glaser @@ -24,6 +24,7 @@ srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.400 2009/06/08 20:34:37 tg Exp $' # CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI # MKSH_CLS_STRING MKSH_BINSHREDUCED MKSH_UNEMPLOYED # MKSH_CONSERVATIVE_FDS MKSH_MIDNIGHTBSD01ASH_COMPAT +# MKSH_NO_LIMITS LC_ALL=C export LC_ALL diff --git a/funcs.c b/funcs.c index 811f0cd..2cd6008 100644 --- a/funcs.c +++ b/funcs.c @@ -25,7 +25,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.111 2009/06/08 20:34:39 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.112 2009/06/08 20:52:27 tg Exp $"); #if HAVE_KILLPG /* @@ -38,6 +38,10 @@ __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.111 2009/06/08 20:34:39 tg Exp $"); #define mksh_kill kill #endif +#ifndef RLIM_INFINITY +#define MKSH_NO_LIMITS +#endif + /* A leading = means assignments before command are kept; * a leading * means a POSIX special builtin; * a leading + means a POSIX regular builtin @@ -2890,7 +2894,7 @@ ptest_error(Test_env *te, int ofs, const char *msg) bi_errorf("%s", msg); } -#ifdef RLIM_INFINITY +#ifndef MKSH_NO_LIMITS #define SOFT 0x1 #define HARD 0x2 @@ -2908,7 +2912,7 @@ static int set_ulimit(const struct limits *, const char *, int); int c_ulimit(const char **wp) { -#ifdef RLIM_INFINITY +#ifndef MKSH_NO_LIMITS static const struct limits limits[] = { /* do not use options -H, -S or -a or change the order */ #ifdef RLIMIT_CPU @@ -3009,7 +3013,7 @@ c_ulimit(const char **wp) return (0); } -#ifdef RLIM_INFINITY +#ifndef MKSH_NO_LIMITS static int set_ulimit(const struct limits *l, const char *v, int how) {