]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
syscall: change RLIM_INFINITY from 0xffffffffffffffff to -1
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Nov 2018 15:30:51 +0000 (15:30 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Nov 2018 15:30:51 +0000 (15:30 +0000)
    For compatibility with the gc toolchain's syscall package.

    Fixes golang/go#28665

    Reviewed-on: https://go-review.googlesource.com/c/148697

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@265974 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/MERGE
libgo/mksysinfo.sh

index 1cdb8a923830e016ff12191b3167ee56b8dc267e..a7077810b289d3fa067f8c6b6ee2d0870e0efc47 100644 (file)
@@ -1,4 +1,4 @@
-5fcfe352ad91945a4f4d0dcfb6309df9bd072c7d
+da8c968474690d1e77442ac3361b2302ea8e1f36
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index b7b9fdcc5b02ab5617d341be1a484a2a85206b0d..2fa7affedb526e006c25e7ed5bb00935d599cfbd 100755 (executable)
@@ -1152,10 +1152,17 @@ grep '^const _RLIMIT_' gen-sysinfo.go |
 grep '^const _RLIM_' gen-sysinfo.go |
     grep -v '^const _RLIM_INFINITY ' |
     sed -e 's/^\(const \)_\(RLIM_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+rliminf=""
 if test "${rlimit}" = "_rlimit64" && grep '^const _RLIM64_INFINITY ' gen-sysinfo.go > /dev/null 2>&1; then
-  echo 'const RLIM_INFINITY = _RLIM64_INFINITY' >> ${OUT}
-elif grep '^const _RLIM_INFINITY ' gen-sysinfo.go > /dev/null 2>&1; then
-  echo 'const RLIM_INFINITY = _RLIM_INFINITY' >> ${OUT}
+  rliminf=`grep '^const _RLIM64_INFINITY ' gen-sysinfo.go | sed -e 's/.* //'`
+else
+  rliminf=`grep '^const _RLIM_INFINITY ' gen-sysinfo.go | sed -e 's/.* //'`
+fi
+# For compatibility with the gc syscall package, treat 0xffffffffffffffff as -1.
+if test "$rliminf" = "0xffffffffffffffff"; then
+  echo "const RLIM_INFINITY = -1" >> ${OUT}
+elif test -n "$rliminf"; then
+  echo "const RLIM_INFINITY = $rliminf" >> ${OUT}
 fi
 
 # The sysinfo struct.