mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-11 08:48:06 +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 <stdio.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <netdb.h> /* gethostbyname */
|
#include <netdb.h> /* gethostbyname */
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -437,9 +438,14 @@ cmd_crash( int socket, const char* cmd, int argc, gchar** argv )
|
||||||
static bool
|
static bool
|
||||||
cmd_shutdown( int socket, const char* cmd, int argc, gchar** argv )
|
cmd_shutdown( int socket, const char* cmd, int argc, gchar** argv )
|
||||||
{
|
{
|
||||||
|
if ( 1 == argc ) {
|
||||||
|
int result = kill( 0, SIGINT );
|
||||||
|
logf( XW_LOGERROR, "%s: kill => %d", __func__, result );
|
||||||
|
} else {
|
||||||
print_to_sock( socket, true,
|
print_to_sock( socket, true,
|
||||||
"* %s -- shuts down relay (exiting main) (unimplemented)",
|
"* %s -- shuts down relay (exiting main)",
|
||||||
cmd );
|
cmd );
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue