From 97578020bb05509514c68625919e472863756e6f Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Fri, 26 Feb 2021 21:36:10 -0600 Subject: [PATCH] Improve shutdown logic in mock syslog server --- testsuite/lib/exec/minlogd.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/lib/exec/minlogd.pl b/testsuite/lib/exec/minlogd.pl index 88b1483..e018f29 100755 --- a/testsuite/lib/exec/minlogd.pl +++ b/testsuite/lib/exec/minlogd.pl @@ -100,8 +100,7 @@ sub handle_command ($) { chomp $command; if ($command eq 'exit') { - print "minlogd: shutting down\n"; - cleanup; exit + $Running = 0; } } @@ -191,9 +190,10 @@ do { accumulate_command if vec($Rrdy, (fileno STDIN), 1); # wait for input - select $Rrdy=$Rchk, undef, undef, undef; + select $Rrdy=$Rchk, undef, undef, undef if $Running; } while ($Running); +print "minlogd: shutting down\n"; cleanup; exit; -- 2.25.1