summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-10-12 10:03:33 +0200
committerPierre Ossman <ossman@cendio.se>2015-10-12 10:03:33 +0200
commitc6cf0571237e5a09b955532a9e48d90c8a5912ac (patch)
treef66d8983b9f74b96af0a8f7c3904962851765346
parentac1e57c064fc462ec2ce0d95452b05c4746edf5a (diff)
parente6e11f9a3ae7233a32034d4e72674561859ad663 (diff)
downloadtigervnc-c6cf0571237e5a09b955532a9e48d90c8a5912ac.tar.gz
tigervnc-c6cf0571237e5a09b955532a9e48d90c8a5912ac.zip
Merge branch 'vncserverfix' of https://github.com/michalsrb/tigervnc
-rwxr-xr-xunix/vncserver8
1 files changed, 7 insertions, 1 deletions
diff --git a/unix/vncserver b/unix/vncserver
index 9ff24411..64d10c5b 100755
--- a/unix/vncserver
+++ b/unix/vncserver
@@ -302,6 +302,7 @@ if ($fontPath ne $defFontPath) {
}
unless (kill 0, `cat $pidFile`) {
warn "Could not start Xvnc.\n\n";
+ unlink $pidFile;
open(LOG, "<$desktopLog");
while (<LOG>) { print; }
close(LOG);
@@ -587,7 +588,12 @@ sub List
print "X DISPLAY #\tPROCESS ID\n";
foreach my $file (@filelist) {
if ($file =~ /$host:(\d+)$\.pid/) {
- print ":".$1."\t\t".`cat $vncUserDir/$file`;
+ chop($tmp_pid = `cat $vncUserDir/$file`);
+ if (kill 0, $tmp_pid) {
+ print ":".$1."\t\t".`cat $vncUserDir/$file`;
+ } else {
+ unlink ($vncUserDir . "/" . $file);
+ }
}
}
exit 1;