diff options
author | Martin Willi <martin@strongswan.org> | 2007-07-27 10:17:50 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2007-07-27 10:17:50 +0000 |
commit | 99652427e97e8f62c70fd126a4327d9071258d7b (patch) | |
tree | bdc36b42dec837931b2eb24979f73b697c67430a /src/dumm/guest.c | |
parent | 539a55a44189e57694e65cf75f5e1040a7fdd37d (diff) | |
download | strongswan-99652427e97e8f62c70fd126a4327d9071258d7b.tar.bz2 strongswan-99652427e97e8f62c70fd126a4327d9071258d7b.tar.xz |
properly shutdown of clients
Diffstat (limited to 'src/dumm/guest.c')
-rw-r--r-- | src/dumm/guest.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dumm/guest.c b/src/dumm/guest.c index 59e501478..784891835 100644 --- a/src/dumm/guest.c +++ b/src/dumm/guest.c @@ -227,10 +227,10 @@ static void stop(private_guest_t *this) { if (this->state != GUEST_STOPPED) { + this->state = GUEST_STOPPING; this->ifaces->destroy_offset(this->ifaces, offsetof(iface_t, destroy)); this->ifaces = linked_list_create(); kill(this->pid, SIGINT); - this->state = GUEST_STOPPING; while (this->state == GUEST_STOPPING) { sched_yield(); @@ -243,6 +243,8 @@ static void stop(private_guest_t *this) */ static void sigchild(private_guest_t *this) { + DESTROY_IF(this->mconsole); + this->mconsole = NULL; this->state = GUEST_STOPPED; this->pid = 0; } @@ -341,7 +343,6 @@ static void destroy(private_guest_t *this) { stop(this); umount_unionfs(this->name); - DESTROY_IF(this->mconsole); free(this->name); free(this->master); free(this); |