diff --git a/unix/vncserver b/unix/vncserver index 91d6f53..0cc9b74 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -119,12 +119,7 @@ sleep(3); &IfXvncDidntStartTryFixingFontPathAndStartXvncAgain(); unless (&IsXvncRunning()) { - warn "Could not start Xvnc.\n\n"; - unlink $pidFile; - open(LOG, "<$desktopLog"); - while () { print; } - close(LOG); - die "\n"; + &WarnUserXvncNotStartedAndExit(); } warn "\nNew '$desktopName' desktop is $host:$displayNumber\n"; @@ -952,3 +947,12 @@ sub IfXvncDidntStartTryFixingFontPathAndStartXvncAgain { sub IsXvncRunning { kill 0, `cat $pidFile`; } + +sub WarnUserXvncNotStartedAndExit { + warn "Could not start Xvnc.\n\n"; + unlink $pidFile; + open(LOG, "<$desktopLog"); + while () { print; } + close(LOG); + die "\n"; +}