mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
fix shutdown to work (by sending signal)
This commit is contained in:
parent
256d6eed90
commit
a33f04e077
1 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue