Save another couple of bytes in the !ulimit case

This commit is contained in:
tg 2009-06-10 18:11:27 +00:00
parent 632ddd50a7
commit 39bb71fc54
3 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.286 2009/06/08 20:34:38 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.287 2009/06/10 18:11:25 tg Stab $
# $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 R38 2009/06/08
@(#)MIRBSD KSH R38 2009/06/10
description:
Check version of shell.
stdin:

12
funcs.c
View File

@ -25,7 +25,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.112 2009/06/08 20:52:27 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.113 2009/06/10 18:11:26 tg Exp $");
#if HAVE_KILLPG
/*
@ -42,6 +42,10 @@ __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.112 2009/06/08 20:52:27 tg Exp $");
#define MKSH_NO_LIMITS
#endif
#ifdef MKSH_NO_LIMITS
#define c_ulimit c_label
#endif
/* A leading = means assignments before command are kept;
* a leading * means a POSIX special builtin;
* a leading + means a POSIX regular builtin
@ -1556,7 +1560,7 @@ c_bind(const char **wp)
return (rv);
}
/* :, false and true */
/* :, false and true (and ulimit if MKSH_NO_LIMITS) */
int
c_label(const char **wp)
{
@ -2907,12 +2911,10 @@ struct limits {
static void print_ulimit(const struct limits *, int);
static int set_ulimit(const struct limits *, const char *, int);
#endif
int
c_ulimit(const char **wp)
{
#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,11 +3011,9 @@ c_ulimit(const char **wp)
shprintf("%-20s ", l->name);
print_ulimit(l, how);
}
#endif
return (0);
}
#ifndef MKSH_NO_LIMITS
static int
set_ulimit(const struct limits *l, const char *v, int how)
{

4
sh.h
View File

@ -122,9 +122,9 @@
#define __SCCSID(x) __IDSTRING(sccsid,x)
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.308 2009/06/08 20:34:40 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.309 2009/06/10 18:11:27 tg Exp $");
#endif
#define MKSH_VERSION "R38 2009/06/08"
#define MKSH_VERSION "R38 2009/06/10"
#ifndef MKSH_INCLUDES_ONLY