diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-02-13 16:41:58 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-02-13 16:45:01 -0500 |
commit | cfc301e0b9d79ff696686a124c7eda470d7611a5 (patch) | |
tree | d81b25a1426a0713821f0fcacf9fe1386329f816 | |
parent | 5a24fdc29c35cb5f00d97c9ac86e3588ece5c095 (diff) | |
download | mbsyncloop-cfc301e0b9d79ff696686a124c7eda470d7611a5.tar.gz mbsyncloop-cfc301e0b9d79ff696686a124c7eda470d7611a5.zip |
allow SIGHUP to immediately recheck mail
-rwxr-xr-x | mbsyncloop | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -56,6 +56,7 @@ if (!$pw_pid) { } my $last_all = 0; +$SIG{HUP} = sub { $last_all = 0 }; while (1) { my $now = time; if (($now - $last_all) >= 14 * 60) { @@ -84,10 +85,12 @@ sub idle { my $rin = ''; vec($rin, fileno($goimapnotify_r), 1) = 1; my $ready = select(my $rout = $rin, undef, undef, $max_delay); + return 0 if $ready == -1 && $! == POSIX::EINTR; die "failed to read goimapnotify output: $!" if $ready == -1; if ($ready) { while (1) { my $ready = select(my $rout = $rin, undef, undef, 0.01); + return 0 if $ready == -1 && $! == POSIX::EINTR; die "failed to read goimapnotify output: $!" if $ready == -1; last unless $ready; sysread $goimapnotify_r, my $data, 4096; |