diff options
author | Adam Tkac <atkac@redhat.com> | 2011-04-27 11:28:09 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2011-04-27 11:28:09 +0000 |
commit | 38ba8cf04294ff81da1452ff2153ad581ae78c61 (patch) | |
tree | 4116ebade2050f5fd921a6d1d511ee0d8bc1e24c /unix/vncserver | |
parent | f586b840bf71f08b900cd3475382a2a5c6d47156 (diff) | |
download | tigervnc-38ba8cf04294ff81da1452ff2153ad581ae78c61.tar.gz tigervnc-38ba8cf04294ff81da1452ff2153ad581ae78c61.zip |
Merged r4361 from 1_1 branch.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4384 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/vncserver')
-rwxr-xr-x | unix/vncserver | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/unix/vncserver b/unix/vncserver index 7fe93bd1..689641f0 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -122,7 +122,7 @@ if ($fontPath eq "") { # Check command line options &ParseOptions("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1, - "-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0); + "-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0,"-autokill",0); &Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'}); @@ -338,10 +338,19 @@ if (-e "/tmp/.X11-unix/X$displayNumber" || $ENV{VNCDESKTOP}= $desktopName; if ($opt{'-fg'}) { - close(STDIN); - system("($vncUserDir/xstartup; $0 -kill :$displayNumber) >> " . "edString($desktopLog) . " 2>&1"); + system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1"); + if (kill 0, `cat $pidFile`) { + $opt{'-kill'} = ':'.$displayNumber; + &Kill(); + } } else { - system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1 &"); + if ($opt{'-autokill'}) { + system("($vncUserDir/xstartup; $0 -kill :$displayNumber) >> " + . "edString($desktopLog) . " 2>&1 &"); + } else { + system("$vncUserDir/xstartup >> " . "edString($desktopLog) + . " 2>&1 &"); + } } exit; @@ -564,6 +573,7 @@ sub Usage " [-pixelformat rgbNNN|bgrNNN]\n". " [-fp <font-path>]\n". " [-fg]\n". + " [-autokill]\n". " <Xvnc-options>...\n\n". " $prog -kill <X-display>\n\n". " $prog -list\n\n"); |