Skip to content

Commit

Permalink
Clean up fdreceiver sockets on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
andreil committed May 28, 2012
1 parent 0515cd3 commit 5772631
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/block-nbd.c
Expand Up @@ -185,6 +185,13 @@ tdnbd_fdreceiver_start()

}

void
tdnbd_fdreceiver_stop()
{
if (fdreceiver)
td_fdreceiver_stop(fdreceiver);
}

static void
__cancel_req(int i, struct td_nbd_request *pos, int e)
{
Expand Down
2 changes: 2 additions & 0 deletions drivers/tapdisk2.c
Expand Up @@ -42,6 +42,7 @@
#include "tapdisk-control.h"

void tdnbd_fdreceiver_start();
void tdnbd_fdreceiver_stop();

static void
usage(const char *app, int err)
Expand Down Expand Up @@ -149,6 +150,7 @@ main(int argc, char *argv[])
err = tapdisk_server_run();

out:
tdnbd_fdreceiver_stop();
tapdisk_control_close();
tapdisk_stop_logging();
return -err;
Expand Down

0 comments on commit 5772631

Please sign in to comment.