aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initscripts.spec2
-rwxr-xr-xprefdm25
2 files changed, 6 insertions, 21 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 7a2a686a..7452e721 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -10,7 +10,7 @@ Patch0: initscripts-s390.patch
BuildRoot: /%{_tmppath}/%{name}-%{version}-%{release}-root
Requires: mingetty, /bin/awk, /bin/sed, mktemp, e2fsprogs >= 1.15
Requires: /sbin/sysctl, sysklogd >= 1.3.31
-Requires: setup >= 2.0.3, /sbin/fuser, which, /bin/grep
+Requires: setup >= 2.0.3, /sbin/fuser, /bin/grep
Requires: modutils >= 2.3.11-5
Requires: util-linux >= 2.10s-11, mount >= 2.11l
Requires: bash >= 2.0, SysVinit
diff --git a/prefdm b/prefdm
index 3d21026d..ad8254e9 100755
--- a/prefdm
+++ b/prefdm
@@ -24,27 +24,12 @@ if [ -f /etc/sysconfig/desktop ]; then
fi
fi
-if [ -z "$preferred" ]; then
- if which gdm >/dev/null 2>&1; then
- preferred=gdm
- elif which kdm >/dev/null 2>&1; then
- preferred=kdm
- elif which xdm >/dev/null 2>&1; then
- preferred=xdm
- fi
-fi
+[ -n "$preferred" ] && exec $preferred $* >/dev/null 2>&1
-if [ -n "$preferred" ] && which $preferred >/dev/null 2>&1; then
- exec `which $preferred` $* >/dev/null 2>&1
-fi
-
-if which gdm >/dev/null 2>&1; then
- exec `which gdm` $* >/dev/null 2>&1
-elif which kdm >/dev/null 2>&1; then
- exec `which kdm` $* >/dev/null 2>&1
-elif which xdm >/dev/null 2>&1; then
- exec `which xdm` $* >/dev/null 2>&1
-fi
+# Fallbacks, in order
+exec gdm $* >/dev/null 2>&1
+exec kdm $* >/dev/null 2>&1
+exec xdm $* >/dev/null 2>&1
# catch all exit error
exit 1