tests/share_ns: always call pthread_exit()

parent 9b53e0b7
...@@ -34,7 +34,9 @@ lxc_test_raw_clone_SOURCES = lxc_raw_clone.c \ ...@@ -34,7 +34,9 @@ lxc_test_raw_clone_SOURCES = lxc_raw_clone.c \
../lxc/utils.c ../lxc/utils.h ../lxc/utils.c ../lxc/utils.h
lxc_test_reboot_SOURCES = reboot.c lxc_test_reboot_SOURCES = reboot.c
lxc_test_saveconfig_SOURCES = saveconfig.c lxc_test_saveconfig_SOURCES = saveconfig.c
lxc_test_share_ns_SOURCES = share_ns.c lxctest.h lxc_test_share_ns_SOURCES = share_ns.c \
lxctest.h \
../lxc/compiler.h
lxc_test_shortlived_SOURCES = shortlived.c lxc_test_shortlived_SOURCES = shortlived.c
lxc_test_shutdowntest_SOURCES = shutdowntest.c lxc_test_shutdowntest_SOURCES = shutdowntest.c
lxc_test_snapshot_SOURCES = snapshot.c lxc_test_snapshot_SOURCES = snapshot.c
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "lxc/lxccontainer.h" #include "lxc/lxccontainer.h"
#include "lxctest.h" #include "lxctest.h"
#include "../lxc/compiler.h"
struct thread_args { struct thread_args {
int thread_id; int thread_id;
...@@ -39,7 +40,7 @@ struct thread_args { ...@@ -39,7 +40,7 @@ struct thread_args {
char inherited_net_ns[4096]; char inherited_net_ns[4096];
}; };
void *ns_sharing_wrapper(void *data) __noreturn void *ns_sharing_wrapper(void *data)
{ {
int init_pid; int init_pid;
ssize_t ret; ssize_t ret;
...@@ -56,7 +57,7 @@ void *ns_sharing_wrapper(void *data) ...@@ -56,7 +57,7 @@ void *ns_sharing_wrapper(void *data)
c = lxc_container_new(name, NULL); c = lxc_container_new(name, NULL);
if (!c) { if (!c) {
lxc_error("Failed to create container \"%s\"\n", name); lxc_error("Failed to create container \"%s\"\n", name);
return NULL; goto out_pthread_exit;
} }
if (c->is_defined(c)) { if (c->is_defined(c)) {
...@@ -168,8 +169,8 @@ out: ...@@ -168,8 +169,8 @@ out:
if (!c->destroy(c)) if (!c->destroy(c))
lxc_error("Failed to destroy container \"%s\"\n", name); lxc_error("Failed to destroy container \"%s\"\n", name);
out_pthread_exit:
pthread_exit(NULL); pthread_exit(NULL);
return NULL;
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment