Hi Monks,
I'm in charge an application daemon which must handle
logoff event.
The sample script is:
use strict; use Win32::API; # sub catch { my $signame = shift; die "bye...\n"; } # my $func = "\&catch"; # my $Con_Event = new Win32::API('kernel32', 'SetConsoleCtrlHandler', 'P +I', 'N'); # if (!$Con_Event) { exit; } my $return = $Con_Event->Call($func, 1); if (!$return) { exit; } # loop for test only for (;;) { }
When in test the system crash and I must reboot.
What's wrong?
Thanks in Advance.
In reply to SetConsoleCtrlHandler Script by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |