diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-02-25 17:36:32 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-02-25 17:36:32 -0600 |
commit | fbf6a3eb40f85504a6e5a95e5ce9e687bf505e29 (patch) | |
tree | 3111342709bace90d782678fac78b7fc10bdb9be | |
parent | ba16d6dba5b368acea00de3acf16a0257c8a7f80 (diff) | |
download | select-retry-fbf6a3eb40f85504a6e5a95e5ce9e687bf505e29.tar.gz select-retry-fbf6a3eb40f85504a6e5a95e5ce9e687bf505e29.zip |
why was i even handling winch specially to begin with
-rw-r--r-- | lib/Select/Retry.pm | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/Select/Retry.pm b/lib/Select/Retry.pm index 2cbcf1b..4ef1ba3 100644 --- a/lib/Select/Retry.pm +++ b/lib/Select/Retry.pm @@ -13,13 +13,6 @@ sub retry_select { : { mode => 'r' }); my (@handles) = @_; - my $got_winch; - my $old_winch = $SIG{WINCH}; - local $SIG{WINCH} = sub { - $got_winch = 1; - $old_winch->() if ref($old_winch) && ref($old_winch) eq 'CODE'; - }; - my ($out, $eout); my ($in, $ein) = (_build_select_vec(@handles)) x 2; my $res; @@ -31,11 +24,14 @@ sub retry_select { } my $again = $!{EAGAIN} || $!{EINTR}; - if (($res == -1 && $again) || $got_winch) { - return retry_select(@_); - } - elsif ($res == -1) { - Carp::croak("select failed: $!"); + if ($res == -1) { + if ($again) { + warn "retrying..."; + return retry_select(@_); + } + else { + Carp::croak("select failed: $!"); + } } return ($out, $eout); |