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:
parent
9f65be6caf
commit
09d73a0662
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278649
@ -53,13 +53,13 @@ ulimit(int cmd, ...)
|
|||||||
va_start(ap, cmd);
|
va_start(ap, cmd);
|
||||||
arg = va_arg(ap, long);
|
arg = va_arg(ap, long);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
if (arg > RLIM_INFINITY / 512 || arg < 0)
|
|
||||||
arg = RLIM_INFINITY / 512;
|
|
||||||
limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512;
|
limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512;
|
||||||
|
|
||||||
/* The setrlimit() function sets errno to EPERM if needed. */
|
/* The setrlimit() function sets errno to EPERM if needed. */
|
||||||
if (setrlimit(RLIMIT_FSIZE, &limit) == -1)
|
if (setrlimit(RLIMIT_FSIZE, &limit) == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
if (arg * 512 > LONG_MAX)
|
||||||
|
return (LONG_MAX);
|
||||||
return (arg);
|
return (arg);
|
||||||
} else {
|
} else {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user