Skip to content

Commit

Permalink
[usb_moded] Enable to re-read mode config with SIGHUP
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Nov 19, 2013
1 parent 3a2acbd commit fc7b073
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/usb_moded.c
Expand Up @@ -563,7 +563,14 @@ static void handle_exit(void)

static void sigint_handler(int signum)
{
handle_exit();
if(signum == SIGINT)
handle_exit();
if(signum == SIGHUP)
{
/* free and read in modelist again */
free_mode_list(modelist);
modelist = read_mode_list(0);
}
}

/* Display usage information */
Expand Down Expand Up @@ -685,6 +692,7 @@ int main(int argc, char* argv[])

/* signal handling */
signal(SIGINT, sigint_handler);
signal(SIGHUP, sigint_handler);

/* init succesful, run main loop */
result = EXIT_SUCCESS;
Expand Down

0 comments on commit fc7b073

Please sign in to comment.