Commit e5e0bc55 by Arjun Sreedharan Committed by Stéphane Graber

tests: try again when waitpid() sets errno as EINTR

when waitpid() is interrupted, errno is not set to the negative value -EINTR. It is set to EINTR. check against EINTR. Signed-off-by: 's avatarArjun Sreedharan <arjun024@gmail.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent a44cafdb
...@@ -48,7 +48,7 @@ static int destroy_busybox(void) ...@@ -48,7 +48,7 @@ static int destroy_busybox(void)
again: again:
ret = waitpid(pid, &status, 0); ret = waitpid(pid, &status, 0);
if (ret == -1) { if (ret == -1) {
if (errno == -EINTR) if (errno == EINTR)
goto again; goto again;
perror("waitpid"); perror("waitpid");
return -1; return -1;
...@@ -80,7 +80,7 @@ static int create_busybox(void) ...@@ -80,7 +80,7 @@ static int create_busybox(void)
again: again:
ret = waitpid(pid, &status, 0); ret = waitpid(pid, &status, 0);
if (ret == -1) { if (ret == -1) {
if (errno == -EINTR) if (errno == EINTR)
goto again; goto again;
perror("waitpid"); perror("waitpid");
return -1; return -1;
......
...@@ -46,7 +46,7 @@ static int create_container(void) ...@@ -46,7 +46,7 @@ static int create_container(void)
again: again:
ret = waitpid(pid, &status, 0); ret = waitpid(pid, &status, 0);
if (ret == -1) { if (ret == -1) {
if (errno == -EINTR) if (errno == EINTR)
goto again; goto again;
perror("waitpid"); perror("waitpid");
return -1; return -1;
......
...@@ -46,7 +46,7 @@ static int create_container(void) ...@@ -46,7 +46,7 @@ static int create_container(void)
again: again:
ret = waitpid(pid, &status, 0); ret = waitpid(pid, &status, 0);
if (ret == -1) { if (ret == -1) {
if (errno == -EINTR) if (errno == EINTR)
goto again; goto again;
perror("waitpid"); perror("waitpid");
return -1; return -1;
......
...@@ -48,7 +48,7 @@ static int destroy_container(void) ...@@ -48,7 +48,7 @@ static int destroy_container(void)
again: again:
ret = waitpid(pid, &status, 0); ret = waitpid(pid, &status, 0);
if (ret == -1) { if (ret == -1) {
if (errno == -EINTR) if (errno == EINTR)
goto again; goto again;
perror("waitpid"); perror("waitpid");
return -1; return -1;
...@@ -80,7 +80,7 @@ static int create_container(void) ...@@ -80,7 +80,7 @@ static int create_container(void)
again: again:
ret = waitpid(pid, &status, 0); ret = waitpid(pid, &status, 0);
if (ret == -1) { if (ret == -1) {
if (errno == -EINTR) if (errno == EINTR)
goto again; goto again;
perror("waitpid"); perror("waitpid");
return -1; return -1;
......
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