diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2016-07-04 16:19:03 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2016-07-04 16:19:03 +0000 |
commit | c26c138cbd59a70c401da45f7527d61ca37a5056 (patch) | |
tree | bc6c04246f6036455339c5c140f73f7babf4e0d5 | |
parent | f00a009841e05a27a2104e79c63a23c7e35e1fbf (diff) |
[testsuite] asan/clone-test-1.c: Handle clone() failure
2016-07-04 Christophe Lyon <christophe.lyon@linaro.org>
* c-c++-common/asan/clone-test-1.c (main): Handle clone() failure.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@237987 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/asan/clone-test-1.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 59a437c0421..9066d0f3afe 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-07-04 Christophe Lyon <christophe.lyon@linaro.org> + + * c-c++-common/asan/clone-test-1.c (main): Handle clone() failure. + 2016-07-04 Dominik Vogt <vogt@linux.vnet.ibm.com> * gcc.target/s390/vector/vec-scalar-cmp-1.c: Expect lochi instead of diff --git a/gcc/testsuite/c-c++-common/asan/clone-test-1.c b/gcc/testsuite/c-c++-common/asan/clone-test-1.c index eeca09f3e68..c58c376f5df 100644 --- a/gcc/testsuite/c-c++-common/asan/clone-test-1.c +++ b/gcc/testsuite/c-c++-common/asan/clone-test-1.c @@ -29,6 +29,10 @@ int main(int argc, char **argv) { char *sp = child_stack + kStackSize; /* Stack grows down. */ printf("Parent: %p\n", sp); pid_t clone_pid = clone(Child, sp, CLONE_FILES | CLONE_VM, NULL, 0, 0, 0); + if (clone_pid == -1) { + perror("clone"); + return 1; + } int status; pid_t wait_result = waitpid(clone_pid, &status, __WCLONE); if (wait_result < 0) { |