1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

Revert 278634: This broke the build due to the compiler being too clever.

Will be back, with proper compiler workarounds.
This commit is contained in:
Pedro F. Giffuni 2015-02-13 00:21:54 +00:00
parent 9f65be6caf
commit 09d73a0662
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278649

View File

@ -53,13 +53,13 @@ ulimit(int cmd, ...)
va_start(ap, cmd);
arg = va_arg(ap, long);
va_end(ap);
if (arg > RLIM_INFINITY / 512 || arg < 0)
arg = RLIM_INFINITY / 512;
limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512;
/* The setrlimit() function sets errno to EPERM if needed. */
if (setrlimit(RLIMIT_FSIZE, &limit) == -1)
return (-1);
if (arg * 512 > LONG_MAX)
return (LONG_MAX);
return (arg);
} else {
errno = EINVAL;