rrent_time = time; if ($sigint_exit) { print "Received exit signal\n"; $sigint_pending = 0; } if ($sigint_report) { if ($current_time >= $sigint_received + 2) { report(); $sigint_report = 0; $sigint_pending = 0; $sigint_processed = 1; } } } } while ($sigint_pending || $sigint_processed); } signal_loop(); report();