diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client.c | 8 | ||||
| -rw-r--r-- | src/server.c | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/client.c b/src/client.c index 89044b0..3117b63 100644 --- a/src/client.c +++ b/src/client.c @@ -404,6 +404,7 @@ int take_cb(char **save) int wait_cb(char **save) { (void) save; + /* debugging */ send_master(REQ_WAIT, NULL, 0); return CMD_OK; } @@ -425,7 +426,10 @@ int go_cb(char **save) int drop_cb(char **save) { char *what = strtok_r(NULL, "", save); - client_drop(what); + if(what) + client_drop(what); + else + out("You must supply an object.\n"); return CMD_OK; } @@ -444,7 +448,7 @@ static const struct client_cmd { { "LOOK", look_cb, false }, { "INVENTORY", inventory_cb, false }, { "TAKE", take_cb, false }, - { "WAIT", wait_cb, false }, + { "WAIT", wait_cb, true }, { "GO", go_cb, false }, { "DROP", drop_cb, false }, }; diff --git a/src/server.c b/src/server.c index ba7d916..6e8dba2 100644 --- a/src/server.c +++ b/src/server.c @@ -255,9 +255,9 @@ static void new_connection_cb(EV_P_ ev_io *w, int revents) int readpipe[2]; /* child->parent */ int outpipe [2]; /* parent->child */ - if(pipe(readpipe) < 0) + if(socketpair(AF_UNIX, SOCK_SEQPACKET, 0, readpipe) < 0) error("error creating pipe, need linux kernel >= 3.4"); - if(pipe(outpipe) < 0) + if(socketpair(AF_UNIX, SOCK_SEQPACKET, 0, outpipe) < 0) error("error creating pipe, need linux kernel >= 3.4"); pid_t pid = fork(); |