From 271dcbc4e8506c809cba48e9d4c8a8125aaf6f11 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 21 Nov 2020 09:12:41 -0500 Subject: [PATCH] select returns EINTR when HUP'd. This is not fatal. Handling this gracefully reduces log spam --- scripts/zmcontrol.pl.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/zmcontrol.pl.in b/scripts/zmcontrol.pl.in index c9a548eef..32c1132d6 100644 --- a/scripts/zmcontrol.pl.in +++ b/scripts/zmcontrol.pl.in @@ -27,7 +27,7 @@ use strict; use ZoneMinder; use Getopt::Long; use autouse 'Pod::Usage'=>qw(pod2usage); -use POSIX qw/strftime EPIPE/; +use POSIX qw/strftime EPIPE EINTR/; use Socket; use Data::Dumper; use Module::Load::Conditional qw{can_load}; @@ -191,7 +191,10 @@ if ( $options{command} ) { Fatal('Bogus descriptor'); } } elsif ( $nfound < 0 ) { - if ( $! == EPIPE ) { + if ( $! == EINTR ) { + # Likely just SIGHUP + Debug("Can't select: $!"); + } elsif ( $! == EPIPE ) { Error("Can't select: $!"); } else { Fatal("Can't select: $!");