Add a counter to ignore the first ctrl+c (especially useful when
sessiond spawn kconsumerd). If the user presses ctrl+c an other time,
kconsumerd dies as expected.
Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca>
/* socket to communicate errors with sessiond */
static int error_socket = -1;
+/* to count the number of time the user pressed ctrl+c */
+static int sigintcount = 0;
+
/* Argument variables */
int opt_quiet;
int opt_verbose;
*/
static void sighandler(int sig)
{
+ if (sig == SIGINT && sigintcount++ == 0) {
+ DBG("ignoring first SIGINT");
+ return;
+ }
+
cleanup();
return;