Without this change it's virtually impossible indicate failure.

Signed-off-by: Matt Helsley <[email protected]>
Cc: [email protected]
---
 futex/plain.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/futex/plain.c b/futex/plain.c
index daf1bef..3b51176 100644
--- a/futex/plain.c
+++ b/futex/plain.c
@@ -110,7 +110,7 @@ void sig_dump(int signum)
 int main(int argc, char **argv)
 {
        pid_t kids[N];
-       int i, num_killed = 0;
+       int i, num_killed = 0, excode = EXIT_FAILURE;
 
        /* FIXME eventually stdio streams should be harmless */
        close(0);
@@ -180,11 +180,12 @@ int main(int argc, char **argv)
                if (num_killed)
                        log("INFO", "killed %d remaining child tasks.\n",
                                num_killed);
-       }
+       } else
+               excode = EXIT_SUCCESS;
        dump("After 2:");
 
        do_wait(N);
        dump("After 3:");
        fclose(logfp);
-       exit(0);
+       exit(excode);
 }
-- 
1.5.6.3

_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to