Fix shutdown procedure
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 9 Jan 2008 16:01:48 +0000 (17:01 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 9 Jan 2008 16:01:48 +0000 (17:01 +0100)
plugins/supplicant.c

index 4787f43..583b1f7 100644 (file)
@@ -244,6 +244,10 @@ int __supplicant_stop(struct connman_iface *iface)
 
        exec_cmd(task, "DETACH");
 
+       sleep(1);
+
+       kill(task->pid, SIGTERM);
+
        //close(task->socket);
        g_io_channel_unref(task->channel);
 
@@ -251,8 +255,6 @@ int __supplicant_stop(struct connman_iface *iface)
                                        "%s/%s.cli", STATEDIR, task->ifname);
        unlink(pathname);
 
-       kill(task->pid, SIGTERM);
-
        free(task->ifname);
 
        g_free(task);