Fix bug in previous commit. We need to trim the limits to fit

the datatype (= long). Use ULONG_MAX and LONG_MAX to avoid
creating MD code.
This commit is contained in:
Marcel Moolenaar 2000-08-26 05:08:10 +00:00
parent 6ba1312ec3
commit 4a22d85023

View File

@ -56,6 +56,7 @@
#include <vm/vm_extern.h>
#include <machine/frame.h>
#include <machine/limits.h>
#include <machine/psl.h>
#include <machine/sysarch.h>
#include <machine/segments.h>
@ -1048,7 +1049,11 @@ linux_getrlimit(p, uap)
return (error);
rlim.rlim_cur = (unsigned long)bsd.rlp->rlim_cur;
if (rlim.rlim_cur == ULONG_MAX)
rlim.rlim_cur = LONG_MAX;
rlim.rlim_max = (unsigned long)bsd.rlp->rlim_max;
if (rlim.rlim_max == ULONG_MAX)
rlim.rlim_max = LONG_MAX;
return (copyout(&rlim, uap->rlim, sizeof(rlim)));
}