Skip to content

Commit

Permalink
fixed formatting - use only tabs, no spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Klinkovský committed Sep 12, 2012
1 parent 6321427 commit 5ec919f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 56 deletions.
75 changes: 38 additions & 37 deletions src/cdm
Expand Up @@ -5,13 +5,13 @@
# Copyright (C) 2009-2011, Daniel J Griffiths <ghost1227@archlinux.us>
# Thanks to:
#
# Andrwe beta-testing and submitting the fix for the all
# important X incrementation function
# brisbin33 code cleanup
# tigrmesh finding a critical issue with the gnome-session handler
# Profjim several incredibly useful patches
# lambchops468 consolekit and hibernation patches
# CasperVector Massive rearchitecturing and code sanitation
# Andrwe beta-testing and submitting the fix for the all
# important X incrementation function
# brisbin33 code cleanup
# tigrmesh finding a critical issue with the gnome-session handler
# Profjim several incredibly useful patches
# lambchops468 consolekit and hibernation patches
# CasperVector Massive rearchitecturing and code sanitation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -46,8 +46,8 @@ yesno()
eval value=\$${1}

case "$value" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1;;
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1;;
*) warn "Invalid value for \`$1'; falling back to \`no' for now.";;
esac
}
Expand Down Expand Up @@ -132,40 +132,40 @@ case ${flaglist[$binindex]} in
[Xx])
clear

# If X is already running and locktty=yes, activate it
# If X is already running and locktty=yes, activate it
if $(yesno locktty); then
if xdpyinfo -display ":$display.0" &> /dev/null; then
chvt "$((display+xtty))"
exitnormal
fi
fi

# Get the first empty display.
display=0
while ((display < 7)); do
if dpyinfo=$(xdpyinfo -display ":$display.0" 2>&1 1>/dev/null) ||
# Display is in use by another user.
[[ "$dpyinfo" == 'No protocol specified'* ]] ||
# Invalid MIT cookie.
[[ "$dpyinfo" == 'Invalid MIT'* ]]
then
let display+=1
else
break
fi
done

# run X in current tty
if [[ $xtty == "keep" ]]; then
vt=$(tty)
vt=${vt#/dev/}
if [[ $vt != tty* ]]; then
error "error: invalid TTY"
exiterror
fi
vt=${vt#tty}
fi

# Get the first empty display.
display=0
while ((display < 7)); do
if dpyinfo=$(xdpyinfo -display ":$display.0" 2>&1 1>/dev/null) ||
# Display is in use by another user.
[[ "$dpyinfo" == 'No protocol specified'* ]] ||
# Invalid MIT cookie.
[[ "$dpyinfo" == 'Invalid MIT'* ]]
then
let display+=1
else
break
fi
done

# run X in current tty
if [[ $xtty == "keep" ]]; then
vt=$(tty)
vt=${vt#/dev/}
if [[ $vt != tty* ]]; then
error "error: invalid TTY"
exiterror
fi
vt=${vt#tty}
else
vt=$((xtty+display))
vt=$((xtty+display))
fi

serverargs=":${display} $serverargs vt$vt"
Expand All @@ -185,3 +185,4 @@ case ${flaglist[$binindex]} in
;;
esac

# vim:set ts=4 sw=4 noet:
40 changes: 21 additions & 19 deletions src/cdm-xlaunch
Expand Up @@ -5,13 +5,13 @@
# Copyright (C) 2009-2011, Daniel J Griffiths <ghost1227@archlinux.us>
# Thanks to:
#
# Andrwe beta-testing and submitting the fix for the all
# important X incrementation function
# brisbin33 code cleanup
# tigrmesh finding a critical issue with the gnome-session handler
# Profjim several incredibly useful patches
# lambchops468 consolekit and hibernation patches
# CasperVector Massive rearchitecturing and code sanisation
# Andrwe beta-testing and submitting the fix for the all
# important X incrementation function
# brisbin33 code cleanup
# tigrmesh finding a critical issue with the gnome-session handler
# Profjim several incredibly useful patches
# lambchops468 consolekit and hibernation patches
# CasperVector Massive rearchitecturing and code sanisation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -82,16 +82,18 @@ nohup startx $* > /dev/null 2>&1 &
# If wait(1) returns with a value >128, it was interrupted by kill(1),
# so registration was sucessful.
if $consolekit; then
if [[ -n "$clockpid" ]]; then
if wait "$clockpid" >& /dev/null
then
kill "$dbuspid"
error "ConsoleKit registration timed out."
exit 1
else
kill "$dbuspid"
info "ConsoleKit registration succeeded."
exit 0
fi
fi
if [[ -n "$clockpid" ]]; then
if wait "$clockpid" >& /dev/null
then
kill "$dbuspid"
error "ConsoleKit registration timed out."
exit 1
else
kill "$dbuspid"
info "ConsoleKit registration succeeded."
exit 0
fi
fi
fi

# vim:set ts=4 sw=4 noet:

0 comments on commit 5ec919f

Please sign in to comment.