From: Christian Brauner Date: Sun, 10 Sep 2017 06:06:26 +0000 (+0200) Subject: tests: remove dead assignments X-Git-Tag: lxc-2.0.9~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1514e67ca8dd95c3e42a8c226a3532efff94e70;p=thirdparty%2Flxc.git tests: remove dead assignments Signed-off-by: Christian Brauner --- 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);