diff --git a/unix/vncserver b/unix/vncserver index ebebe70..91d6f53 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -118,7 +118,7 @@ sleep(3); &IfXvncDidntStartTryFixingFontPathAndStartXvncAgain(); -unless (kill 0, `cat $pidFile`) { +unless (&IsXvncRunning()) { warn "Could not start Xvnc.\n\n"; unlink $pidFile; open(LOG, "<$desktopLog"); @@ -930,7 +930,7 @@ sub StartXvncAndRecordPID { sub IfXvncDidntStartTryFixingFontPathAndStartXvncAgain { if ($fontPath ne $defFontPath) { - unless (kill 0, `cat $pidFile`) { + unless (&IsXvncRunning()) { if ($fpArgSpecified) { warn "\nWARNING: The first attempt to start Xvnc failed, probably because the font\n"; warn "path you specified using the -fp argument is incorrect. Attempting to\n"; @@ -948,3 +948,7 @@ sub IfXvncDidntStartTryFixingFontPathAndStartXvncAgain { } } } + +sub IsXvncRunning { + kill 0, `cat $pidFile`; +}