]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: try again when waitpid() sets errno as EINTR
authorArjun Sreedharan <arjun024@gmail.com>
Thu, 4 Dec 2014 08:56:04 +0000 (14:26 +0530)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 4 Dec 2014 16:48:00 +0000 (11:48 -0500)
when waitpid() is interrupted, errno is not set to the negative
value -EINTR. It is set to EINTR. check against EINTR.

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/tests/containertests.c
src/tests/destroytest.c
src/tests/saveconfig.c
src/tests/startone.c

index 923085350e6f94e92bfd2c6f9f49eed242821ed8..d093a02a849df9efc68ee47d0e1fbc3cc0187ce1 100644 (file)
@@ -48,7 +48,7 @@ static int destroy_busybox(void)
 again:
        ret = waitpid(pid, &status, 0);
        if (ret == -1) {
-               if (errno == -EINTR)
+               if (errno == EINTR)
                        goto again;
                perror("waitpid");
                return -1;
@@ -80,7 +80,7 @@ static int create_busybox(void)
 again:
        ret = waitpid(pid, &status, 0);
        if (ret == -1) {
-               if (errno == -EINTR)
+               if (errno == EINTR)
                        goto again;
                perror("waitpid");
                return -1;
index 4bb6aaead850e0dae6262836ff214cb799bcb4e1..eaf3c84d07c06e7eae527cc9081be8d1f1a97946 100644 (file)
@@ -46,7 +46,7 @@ static int create_container(void)
 again:
        ret = waitpid(pid, &status, 0);
        if (ret == -1) {
-               if (errno == -EINTR)
+               if (errno == EINTR)
                        goto again;
                perror("waitpid");
                return -1;
index de2fa82b6d32cafc4c0c6e2522a9195e1bb43c86..d8a4ca271d6116ab94f3c8d49c524a1ab7b4a621 100644 (file)
@@ -46,7 +46,7 @@ static int create_container(void)
 again:
        ret = waitpid(pid, &status, 0);
        if (ret == -1) {
-               if (errno == -EINTR)
+               if (errno == EINTR)
                        goto again;
                perror("waitpid");
                return -1;
index 9dd4ec3e61c0d39bed5b8cbb172bcf7f4f8e7246..6b7344f6685afa4ce64761d9ed7584fcb34bdb60 100644 (file)
@@ -48,7 +48,7 @@ static int destroy_container(void)
 again:
        ret = waitpid(pid, &status, 0);
        if (ret == -1) {
-               if (errno == -EINTR)
+               if (errno == EINTR)
                        goto again;
                perror("waitpid");
                return -1;
@@ -80,7 +80,7 @@ static int create_container(void)
 again:
        ret = waitpid(pid, &status, 0);
        if (ret == -1) {
-               if (errno == -EINTR)
+               if (errno == EINTR)
                        goto again;
                perror("waitpid");
                return -1;