emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 4e182dc: Port to platforms where rlim_max < 0


From: Paul Eggert
Subject: [Emacs-diffs] master 4e182dc: Port to platforms where rlim_max < 0
Date: Fri, 27 May 2016 20:55:28 +0000 (UTC)

branch: master
commit 4e182dce20bd09e38a69bdf637a3bf2a8bbfdc58
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Port to platforms where rlim_max < 0
    
    * src/emacs.c (main): Do not treat a negative rlim_max as a limit;
    this can happen if a special value like RLIM_INFINITY is negative.
---
 src/emacs.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/emacs.c b/src/emacs.c
index bdcebbe..b8ba86f 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -851,11 +851,14 @@ main (int argc, char **argv)
          /* Round the new limit to a page boundary; this is needed
             for Darwin kernel 15.4.0 (see Bug#23622) and perhaps
             other systems.  Do not shrink the stack and do not exceed
-            rlim_max.  Don't worry about values like RLIM_INFINITY
-            since in practice they are so large that the code does
-            the right thing anyway.  */
+            rlim_max.  Don't worry about exact values of
+            RLIM_INFINITY etc. since in practice when they are
+            nonnegative they are so large that the code does the
+            right thing anyway.  */
          long pagesize = getpagesize ();
-         newlim = min (newlim + pagesize - 1, rlim.rlim_max);
+         newlim += pagesize - 1;
+         if (0 <= rlim.rlim_max && rlim.rlim_max < newlim)
+           newlim = rlim.rlim_max;
          newlim -= newlim % pagesize;
 
          if (pagesize <= newlim - lim)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]