diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2018-04-09 17:53:37 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2018-04-09 17:53:37 +0000 |
commit | 7ae1233120b38422f81a59bacc318bd84cef8c0d (patch) | |
tree | ab48dade145a01c7a353f7bacb267a448dea421b /bin/ksh/c_ulimit.c | |
parent | d988e6496b65d119543ad814244e09724611c26b (diff) |
Support 64 bit integers on 32 bit architectures.
No binary change on amd64 and there should be no differences on any
other 64 bit architecture either (because long = int64_t).
ok cheloha, tb
Diffstat (limited to 'bin/ksh/c_ulimit.c')
-rw-r--r-- | bin/ksh/c_ulimit.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/ksh/c_ulimit.c b/bin/ksh/c_ulimit.c index 2dd36672ac8..1ba64f46707 100644 --- a/bin/ksh/c_ulimit.c +++ b/bin/ksh/c_ulimit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: c_ulimit.c,v 1.27 2018/03/15 16:51:29 anton Exp $ */ +/* $OpenBSD: c_ulimit.c,v 1.28 2018/04/09 17:53:36 tobias Exp $ */ /* ulimit -- handle "ulimit" builtin @@ -22,6 +22,7 @@ #include <ctype.h> #include <errno.h> +#include <inttypes.h> #include <string.h> #include "sh.h" @@ -139,7 +140,7 @@ set_ulimit(const struct limits *l, const char *v, int how) if (strcmp(v, "unlimited") == 0) val = RLIM_INFINITY; else { - long rval; + int64_t rval; if (!evaluate(v, &rval, KSH_RETURN_ERROR, false)) return 1; @@ -187,6 +188,6 @@ print_ulimit(const struct limits *l, int how) shprintf("unlimited\n"); else { val /= l->factor; - shprintf("%ld\n", (long) val); + shprintf("%" PRIi64 "\n", (int64_t) val); } } |