Commit 8f672563 authored by Georgi Chorbadzhiyski's avatar Georgi Chorbadzhiyski

When CMD_SHUTDOWN is received set b_exit_now flag to exit cleanly.

parent 32c854f8
...@@ -148,10 +148,10 @@ void comm_Read( void ) ...@@ -148,10 +148,10 @@ void comm_Read( void )
break; break;
case CMD_SHUTDOWN: case CMD_SHUTDOWN:
msg_Err( NULL, "shutdown via comm" ); b_exit_now = 1;
exit(EXIT_SUCCESS); i_answer = RET_OK;
/* this is a bit violent, but hey, closing everything cleanly i_answer_size = 0;
* would do approximately the same */ break;
default: default:
msg_Err( NULL, "wrong command %u", i_command ); msg_Err( NULL, "wrong command %u", i_command );
......
...@@ -166,6 +166,7 @@ extern uint8_t *p_network_name; ...@@ -166,6 +166,7 @@ extern uint8_t *p_network_name;
extern size_t i_network_name_size; extern size_t i_network_name_size;
extern mtime_t i_wallclock; extern mtime_t i_wallclock;
extern volatile int b_hup_received; extern volatile int b_hup_received;
extern volatile int b_exit_now;
extern int i_comm_fd; extern int i_comm_fd;
extern char *psz_udp_src; extern char *psz_udp_src;
extern int i_asi_adapter; extern int i_asi_adapter;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment