[PATCH] Clean up correctly on more signals

dinkypumpkin dinkypumpkin at gmail.com
Mon Oct 20 06:23:53 PDT 2014


On 20/10/2014 13:20, Mike Crowe wrote:
> Ensure that everything is cleaned up even if get_iplayer is killed by other
> signals.
>
> Signed-off-by: Mike Crowe <mac at mcrowe.com>
> ---
>   get_iplayer |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/get_iplayer b/get_iplayer
> index 6225c74..5079742 100755
> --- a/get_iplayer
> +++ b/get_iplayer
> @@ -573,7 +573,7 @@ for ( progclass() ) {
>   }
>
>   # Setup signal handlers
> -$SIG{INT} = $SIG{PIPE} = \&cleanup;
> +$SIG{TERM} = $SIG{HUP} = $SIG{ALRM} = $SIG{INT} = $SIG{PIPE} = \&cleanup;
>
>   # Other Non option-dependant vars
>   my $historyfile		= "${profile_dir}/download_history";
>

Signal handlers get reset and restored in run_cmd().  Did you 
intentionally leave that code as-is?  It seems like you would want to 
handle HUP and ALRM there as well.  That's where get_iplayer spends most 
of its time, running rtmpdump.



More information about the get_iplayer mailing list