fix shutdown to work (by sending signal)

This commit is contained in:
Eric House 2013-10-25 06:10:18 -07:00
parent 256d6eed90
commit a33f04e077

View file

@ -20,6 +20,7 @@
*/
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <netdb.h> /* gethostbyname */
#include <errno.h>
@ -437,9 +438,14 @@ cmd_crash( int socket, const char* cmd, int argc, gchar** argv )
static bool
cmd_shutdown( int socket, const char* cmd, int argc, gchar** argv )
{
print_to_sock( socket, true,
"* %s -- shuts down relay (exiting main) (unimplemented)",
cmd );
if ( 1 == argc ) {
int result = kill( 0, SIGINT );
logf( XW_LOGERROR, "%s: kill => %d", __func__, result );
} else {
print_to_sock( socket, true,
"* %s -- shuts down relay (exiting main)",
cmd );
}
return false;
}