From ac51bd1d575a52d84828e542d7fabb3ed7f37688 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Fri, 13 Aug 2021 00:10:40 +1200 Subject: [PATCH] vncserver: refactor --- unix/vncserver | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/vncserver b/unix/vncserver index 1ab0da7..47af91e 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -373,12 +373,12 @@ sub Kill chop($pid = `cat $pidFile`); warn "Killing Xvnc process ID $pid\n"; - if (kill 0, $pid) { + if (&IsProcessRunning($pid)) { system("kill $pid"); &WaitForTimeLimitOrSubReturningTrue(1, sub { !IsProcessRunning($pid) }); - if (kill 0, $pid) { + if (&IsProcessRunning($pid)) { print "Xvnc seems to be deadlocked. Kill the process manually and then re-run\n"; print " ".$0." -kill ".$opt{'-kill'}."\n"; print "to clean up the socket files.\n";