From: Ian Lance Taylor Date: Tue, 27 Sep 2011 13:16:22 +0000 (+0000) Subject: mksysinfo: Fix for systems that don't define TIOCSCTTY. X-Git-Tag: releases/gcc-4.7.0~3517 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3019bbaeb3c0156d6e9ca646850a99054963301a;p=thirdparty%2Fgcc.git mksysinfo: Fix for systems that don't define TIOCSCTTY. From Rainer Orth. From-SVN: r179269 --- diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh index 2b5acd6051f1..85dd33c65d09 100755 --- a/libgo/mksysinfo.sh +++ b/libgo/mksysinfo.sh @@ -499,6 +499,14 @@ grep '^type _passwd ' gen-sysinfo.go | \ grep '^const _TIOC' gen-sysinfo.go | \ sed -e 's/^\(const \)_\(TIOC[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} +# ioctl constants. Might fall back to 0 if TIOCNXCL is missing, too, but +# needs handling in syscalls.exec.go. +if ! grep '^const _TIOCSCTTY ' gen-sysinfo.go >/dev/null 2>&1; then + if grep '^const _TIOCNXCL ' gen-sysinfo.go >/dev/null 2>&1; then + echo "const TIOCSCTTY = TIOCNXCL" >> ${OUT} + fi +fi + # The nlmsghdr struct. grep '^type _nlmsghdr ' gen-sysinfo.go | \ sed -e 's/_nlmsghdr/NlMsghdr/' \