vncserver: extract WaitForXvncToStart()

This commit is contained in:
Dmitry Maksyoma 2021-08-02 23:05:29 +12:00
parent df5d3e506d
commit 7ee1522143

View File

@ -112,9 +112,7 @@ $cmd = &ConstructXvncCmd();
# Run $cmd and record the process ID.
$pidFile = "$vncUserDir/$host:$displayNumber.pid";
&StartXvncAndRecordPID();
# Give Xvnc a chance to start up
sleep(3);
&WaitForXvncToStart();
&IfXvncDidntStartTryFixingFontPathAndStartXvncAgain();
@ -939,7 +937,7 @@ sub IfXvncDidntStartTryFixingFontPathAndStartXvncAgain {
$cmd =~ s@-fp [^ ]+@@;
$cmd .= " -fp $defFontPath" if ($defFontPath);
&StartXvncAndRecordPID();
sleep(3);
&WaitForXvncToStart();
}
}
}
@ -956,3 +954,7 @@ sub WarnUserXvncNotStartedAndExit {
close(LOG);
die "\n";
}
sub WaitForXvncToStart {
sleep(3);
}