summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRickie Schroeder <1187-Gregg16@users.noreply.gitlab.freedesktop.org>2020-08-28 13:34:05 +0000
committerRickie Schroeder <1187-Gregg16@users.noreply.gitlab.freedesktop.org>2020-08-28 13:34:05 +0000
commite2430bcb8327682340d985f89ad5137efa2f0d4f (patch)
treef8b81cdbfa6e2091267fb4fb1707de34ebe1c311
parent91d2aba6364ec6685411595ccafea69fe9d20d6c (diff)
downloadxorg-app-xinit-e2430bcb8327682340d985f89ad5137efa2f0d4f.tar.gz
startx: use uname -n instead of hostname
startx calls hostname to obtain the hostname, but this is not defined by POSIX, so not guaranteed to work. The script already does some checks to deal with different hostname implementations on Linux. Using uname -n instead fixes this in a portable way.
-rw-r--r--startx.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/startx.cpp b/startx.cpp
index a390f03..33b9eb7 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -251,18 +251,7 @@ if [ x"$enable_xauth" = x1 ] ; then
removelist=
XCOMM set up default Xauth info for this machine
- case `uname` in
- Linux*)
- if [ -z "`hostname --version 2>&1 | grep GNU`" ]; then
- hostname=`hostname -f`
- else
- hostname=`hostname`
- fi
- ;;
- *)
- hostname=`hostname`
- ;;
- esac
+ hostname=`uname -n`
authdisplay=${display:-:0}
#if defined(HAS_COOKIE_MAKER) && defined(MK_COOKIE)