[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] console-client: Exit on SIGTERM
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] console-client: Exit on SIGTERM |
Date: |
Thu, 17 Jul 2014 18:40:45 +0200 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
David Michael, le Wed 16 Jul 2014 21:56:36 -0400, a écrit :
> +/* Exit the console client on SIGTERM. */
> +static void
> +signal_handler (int signum)
> +{
> + if (signum == SIGTERM)
> + console_exit ();
> +}
We can't just call console_exit() in the middle of the signal handler:
SIGTERM could very well happen while driver_list_lock is taken,
driver_fini would then deadlock. The signal handler should rather make
the cons_server_loop function return.
Samuel