summaryrefslogtreecommitdiff
path: root/startx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'startx.cpp')
-rw-r--r--startx.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/startx.cpp b/startx.cpp
index c31fd7f..c31ae10 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -243,7 +243,11 @@ if [ x"$enable_xauth" = x1 ] ; then
#if defined(HAS_COOKIE_MAKER) && defined(MK_COOKIE)
mcookie=`MK_COOKIE`
#else
- mcookie=`dd if=/dev/random bs=16 count=1 2>/dev/null | hexdump -e \\"%08x\\"`
+ if [ -r /dev/urandom ]; then
+ mcookie=`dd if=/dev/urandom bs=16 count=1 2>/dev/null | hexdump -e \\"%08x\\"`
+ else
+ mcookie=`dd if=/dev/random bs=16 count=1 2>/dev/null | hexdump -e \\"%08x\\"`
+ fi
if test x"$mcookie" = x; then
echo "Couldn't create cookie"
exit 1