home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.046 < prev    next >
Encoding:
Internet Message Format  |  2001-10-30  |  4.5 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.046
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.046
  11. Problem:    When getrlimit() returns an 8 byte number the check for running
  12.         out of stack may fail. (Anthony Meijer)
  13. Solution:   Skip the stack check if the limit doesn't fit in a long.
  14. Files:        src/auto/configure, src/config.h.in, src/configure.in,
  15.         src/os_unix.c
  16.  
  17.  
  18. *** ../vim60.45/src/auto/configure    Fri Sep 28 17:39:10 2001
  19. --- src/auto/configure    Wed Oct 31 13:52:02 2001
  20. ***************
  21. *** 5145,5158 ****
  22.   
  23.   fi
  24.   
  25.   
  26.   echo $ac_n "checking for stack_t""... $ac_c" 1>&6
  27. ! echo "configure:5151: checking for stack_t" >&5
  28.   if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then
  29.     echo "$ac_t""(cached) $ac_cv_type_stack_t" 1>&6
  30.   else
  31.     cat > conftest.$ac_ext <<EOF
  32. ! #line 5156 "configure"
  33.   #include "confdefs.h"
  34.   
  35.   #include "confdefs.h"
  36. --- 5145,5191 ----
  37.   
  38.   fi
  39.   
  40. + echo $ac_n "checking for rlim_t""... $ac_c" 1>&6
  41. + echo "configure:5150: checking for rlim_t" >&5
  42. + if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then
  43. +   echo $ac_n "(cached) $ac_c" 1>&6
  44. + else
  45. +   cat > conftest.$ac_ext <<EOF
  46. + #line 5155 "configure"
  47. + #include "confdefs.h"
  48. + #include <sys/types.h>
  49. + #if STDC_HEADERS
  50. + #include <stdlib.h>
  51. + #include <stddef.h>
  52. + #endif
  53. + EOF
  54. + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  55. +   egrep "(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  56. +   rm -rf conftest*
  57. +   ac_cv_type_rlim_t=yes
  58. + else
  59. +   rm -rf conftest*
  60. +   ac_cv_type_rlim_t=no
  61. + fi
  62. + rm -f conftest*
  63. + fi
  64. + echo "$ac_t""$ac_cv_type_rlim_t" 1>&6
  65. + if test $ac_cv_type_rlim_t = no; then
  66. +   cat >> confdefs.h <<\EOF
  67. + #define rlim_t unsigned long
  68. + EOF
  69. + fi
  70.   
  71.   echo $ac_n "checking for stack_t""... $ac_c" 1>&6
  72. ! echo "configure:5184: checking for stack_t" >&5
  73.   if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then
  74.     echo "$ac_t""(cached) $ac_cv_type_stack_t" 1>&6
  75.   else
  76.     cat > conftest.$ac_ext <<EOF
  77. ! #line 5189 "configure"
  78.   #include "confdefs.h"
  79.   
  80.   #include "confdefs.h"
  81. *** ../vim60.45/src/config.h.in    Sat Jul 14 14:56:13 2001
  82. --- src/config.h.in    Wed Oct 31 13:50:02 2001
  83. ***************
  84. *** 86,91 ****
  85. --- 86,94 ----
  86.   /* Define to `unsigned' if <sys/types.h> doesn't define.  */
  87.   #undef dev_t
  88.   
  89. + /* Define to `unsigned long' if <sys/types.h> doesn't define.  */
  90. + #undef rlim_t
  91.   /* Define to `struct sigaltstack' if <signal.h> doesn't define.  */
  92.   #undef stack_t
  93.   
  94. *** ../vim60.45/src/configure.in    Fri Sep 28 17:39:10 2001
  95. --- src/configure.in    Wed Oct 31 13:49:25 2001
  96. ***************
  97. *** 1405,1410 ****
  98. --- 1405,1411 ----
  99.   AC_HEADER_TIME
  100.   AC_CHECK_TYPE(ino_t, long)
  101.   AC_CHECK_TYPE(dev_t, unsigned)
  102. + AC_CHECK_TYPE(rlim_t, unsigned long)
  103.   
  104.   AC_MSG_CHECKING(for stack_t)
  105.   if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then
  106. *** ../vim60.45/src/os_unix.c    Thu Oct 25 16:34:24 2001
  107. --- src/os_unix.c    Wed Oct 31 13:46:36 2001
  108. ***************
  109. *** 428,433 ****
  110. --- 428,434 ----
  111.       struct rlimit    rlp;
  112.   
  113.       if (getrlimit(RLIMIT_DATA, &rlp) == 0
  114. +         && rlp.rlim_cur < ((rlim_t)1 << (sizeof(long_u) * 8 - 1))
  115.   #  ifdef RLIM_INFINITY
  116.           && rlp.rlim_cur != RLIM_INFINITY
  117.   #  endif
  118. ***************
  119. *** 544,551 ****
  120.       struct rlimit    rlp;
  121.       int            i;
  122.   
  123. !     /* Set the stack limit to 15/16 of the allowable size. */
  124.       if (getrlimit(RLIMIT_STACK, &rlp) == 0
  125.   #  ifdef RLIM_INFINITY
  126.           && rlp.rlim_cur != RLIM_INFINITY
  127.   #  endif
  128. --- 545,554 ----
  129.       struct rlimit    rlp;
  130.       int            i;
  131.   
  132. !     /* Set the stack limit to 15/16 of the allowable size.  Skip this when the
  133. !      * limit doesn't fit in a long (rlim_cur might be "long long"). */
  134.       if (getrlimit(RLIMIT_STACK, &rlp) == 0
  135. +         && rlp.rlim_cur < ((rlim_t)1 << (sizeof(long_u) * 8 - 1))
  136.   #  ifdef RLIM_INFINITY
  137.           && rlp.rlim_cur != RLIM_INFINITY
  138.   #  endif
  139. *** ../vim60.45/src/version.c    Wed Oct 31 11:56:35 2001
  140. --- src/version.c    Wed Oct 31 14:12:00 2001
  141. ***************
  142. *** 608,609 ****
  143. --- 608,611 ----
  144.   {   /* Add new patch number below this line */
  145. + /**/
  146. +     46,
  147.   /**/
  148.  
  149. -- 
  150. No man may purchase alcohol without written consent from his wife.
  151.         [real standing law in Pennsylvania, United States of America]
  152.  
  153.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  154. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  155.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  156.