Susv3mon says: rlim_t are unsigned

This commit is contained in:
tg 2012-03-26 21:10:44 +00:00
parent 80becae42d
commit 4f8b7de3a9
3 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.522 2012/03/26 00:25:52 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.523 2012/03/26 21:10:38 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 $
@ -29,7 +29,7 @@
# http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD
expected-stdout:
@(#)MIRBSD KSH R40 2012/03/25
@(#)MIRBSD KSH R40 2012/03/26
description:
Check version of shell.
stdin:

10
funcs.c
View File

@ -38,7 +38,7 @@
#endif
#endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.209 2012/03/24 18:47:04 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.210 2012/03/26 21:10:42 tg Exp $");
#if HAVE_KILLPG
/*
@ -3251,7 +3251,7 @@ ptest_error(Test_env *te, int ofs, const char *msg)
struct limits {
const char *name;
int resource; /* resource to get/set */
int factor; /* multiply by to get rlim_{cur,max} values */
unsigned int factor; /* multiply by to get rlim_{cur,max} values */
char option;
};
@ -3447,9 +3447,9 @@ set_ulimit(const struct limits *l, const char *v, int how)
if (strcmp(v, "unlimited") == 0)
val = (rlim_t)RLIM_INFINITY;
else {
mksh_ari_t rval;
mksh_uari_t rval;
if (!evaluate(v, &rval, KSH_RETURN_ERROR, false))
if (!evaluate(v, (mksh_ari_t *)&rval, KSH_RETURN_ERROR, false))
return (1);
/*
* Avoid problems caused by typos that evaluate misses due
@ -3499,7 +3499,7 @@ print_ulimit(const struct limits *l, int how)
if (val == (rlim_t)RLIM_INFINITY)
shf_puts("unlimited\n", shl_stdout);
else
shprintf("%ld\n", (long)(val / l->factor));
shprintf("%lu\n", (unsigned long)(val / l->factor));
}
#endif

6
sh.h
View File

@ -152,9 +152,9 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.528 2012/03/25 14:28:14 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.529 2012/03/26 21:10:44 tg Exp $");
#endif
#define MKSH_VERSION "R40 2012/03/25"
#define MKSH_VERSION "R40 2012/03/26"
/* arithmetic types: C implementation */
#if !HAVE_CAN_INTTYPES
@ -196,7 +196,7 @@ typedef u_int8_t uint8_t;
/* other standard types */
#if !HAVE_RLIM_T
typedef long rlim_t;
typedef unsigned long rlim_t;
#endif
#if !HAVE_SIG_T