From b1514e67ca8dd95c3e42a8c226a3532efff94e70 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sun, 10 Sep 2017 08:06:26 +0200 Subject: [PATCH] tests: remove dead assignments Signed-off-by: Christian Brauner --- src/tests/containertests.c | 12 ++++-------- src/tests/destroytest.c | 6 ++---- src/tests/saveconfig.c | 6 ++---- src/tests/shortlived.c | 12 ++++-------- src/tests/startone.c | 12 ++++-------- 5 files changed, 16 insertions(+), 32 deletions(-) diff --git a/src/tests/containertests.c b/src/tests/containertests.c index dbfccb1f4..256ff60fd 100644 --- a/src/tests/containertests.c +++ b/src/tests/containertests.c @@ -40,10 +40,8 @@ static int destroy_busybox(void) return -1; } if (pid == 0) { - ret = execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); - // Should not return - perror("execl"); - exit(1); + execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); + exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); @@ -72,10 +70,8 @@ static int create_busybox(void) return -1; } if (pid == 0) { - ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); - // Should not return - perror("execl"); - exit(1); + execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); + exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); diff --git a/src/tests/destroytest.c b/src/tests/destroytest.c index eaf3c84d0..b8ba8055d 100644 --- a/src/tests/destroytest.c +++ b/src/tests/destroytest.c @@ -38,10 +38,8 @@ static int create_container(void) return -1; } if (pid == 0) { - ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); - // Should not return - perror("execl"); - exit(1); + execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); + exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); diff --git a/src/tests/saveconfig.c b/src/tests/saveconfig.c index d8a4ca271..58f4d24b6 100644 --- a/src/tests/saveconfig.c +++ b/src/tests/saveconfig.c @@ -38,10 +38,8 @@ static int create_container(void) return -1; } if (pid == 0) { - ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); - // Should not return - perror("execl"); - exit(1); + execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); + exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); diff --git a/src/tests/shortlived.c b/src/tests/shortlived.c index aff0e7d4f..6472ce7e0 100644 --- a/src/tests/shortlived.c +++ b/src/tests/shortlived.c @@ -40,10 +40,8 @@ static int destroy_container(void) return -1; } if (pid == 0) { - ret = execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); - // Should not return - perror("execl"); - exit(1); + execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); + exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); @@ -72,10 +70,8 @@ static int create_container(void) return -1; } if (pid == 0) { - ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); - // Should not return - perror("execl"); - exit(1); + execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); + exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); diff --git a/src/tests/startone.c b/src/tests/startone.c index 6b7344f66..2b061d0e0 100644 --- a/src/tests/startone.c +++ b/src/tests/startone.c @@ -40,10 +40,8 @@ static int destroy_container(void) return -1; } if (pid == 0) { - ret = execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); - // Should not return - perror("execl"); - exit(1); + execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); + exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); @@ -72,10 +70,8 @@ static int create_container(void) return -1; } if (pid == 0) { - ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); - // Should not return - perror("execl"); - exit(1); + execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); + exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); -- 2.47.2