diff options
author | Yvan Roux <yvan.roux@linaro.org> | 2016-09-04 23:29:55 +0200 |
---|---|---|
committer | Yvan Roux <yvan.roux@linaro.org> | 2016-09-07 22:08:43 +0200 |
commit | dee846401155b205e75b61b3d3f2ad9617317dbb (patch) | |
tree | 76f02c60895deb0bfcc11f0449470afc181007c8 | |
parent | 3b3aaab86ab9ed5e10daf40cadf3a929ecb57e67 (diff) |
gcc/testsuite/
Backport from trunk r237987.
2016-07-04 Christophe Lyon <christophe.lyon@linaro.org>
* c-c++-common/asan/clone-test-1.c (main): Handle clone() failure.
Change-Id: I71234a438d4247e89b3ce309a6cb1336fdf7f90b
-rw-r--r-- | gcc/testsuite/c-c++-common/asan/clone-test-1.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 fd187aaadd2..92f67508faa 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) { |