diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2016-07-04 16:19:03 +0000 |
---|---|---|
committer | Christophe Lyon <clyon@gcc.gnu.org> | 2016-07-04 18:19:03 +0200 |
commit | 740f9751fbd5ab7475cd358a6f60e4ab04b923cd (patch) | |
tree | bc6c04246f6036455339c5c140f73f7babf4e0d5 /gcc/testsuite/c-c++-common | |
parent | 097e8994956a7307883226479491c402af1e4e7e (diff) | |
download | gcc-740f9751fbd5ab7475cd358a6f60e4ab04b923cd.zip gcc-740f9751fbd5ab7475cd358a6f60e4ab04b923cd.tar.gz gcc-740f9751fbd5ab7475cd358a6f60e4ab04b923cd.tar.bz2 |
[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.
From-SVN: r237987
Diffstat (limited to 'gcc/testsuite/c-c++-common')
-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 eeca09f..c58c376 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) { |