From c831d399afb01adc17027ecf73fdd363104ca6aa Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 20 Nov 1999 05:10:14 +0000 Subject: [PATCH] (__setrlimit): Don't modify the rlimits structure passed in. --- sysdeps/unix/sysv/linux/setrlimit.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/sysv/linux/setrlimit.c b/sysdeps/unix/sysv/linux/setrlimit.c index 422aa303a7c..f0c3e41e07d 100644 --- a/sysdeps/unix/sysv/linux/setrlimit.c +++ b/sysdeps/unix/sysv/linux/setrlimit.c @@ -39,6 +39,8 @@ __setrlimit (resource, rlimits) enum __rlimit_resource resource; const struct rlimit *rlimits; { + struct rlimit rlimits_small; + #ifdef __NR_ugetrlimit if (! no_new_getrlimit) { @@ -55,10 +57,10 @@ __setrlimit (resource, rlimits) /* We might have to correct the limits values. Since the old values were signed the new values are too large. */ - rlimits->rlim_cur = MIN ((unsigned long int) rlimits->rlim_cur, - RLIM_INFINITY >> 2); - rlimits->rlim_max = MIN ((unsigned long int) rlimits->rlim_max, - RLIM_INFINITY >> 2); + rlimits_small.rlim_cur = MIN ((unsigned long int) rlimits->rlim_cur, + RLIM_INFINITY >> 2); + rlimits_small.rlim_max = MIN ((unsigned long int) rlimits->rlim_max, + RLIM_INFINITY >> 2); /* Fall back on the old system call. */ return INLINE_SYSCALL (setrlimit, 2, resource, rlimits); -- 2.47.2