diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2018-04-26 08:53:21 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2018-04-26 08:53:21 +0000 |
commit | 2baa5e855db35fbf05b44b19b966436e88ce4ee0 (patch) | |
tree | f516bc4b7d13e3f1399df2d94c199ac128690f93 | |
parent | a9d068f7f2dfeb1a9593747975c834fb563ee9f7 (diff) |
failure for exiting on signal
-rw-r--r-- | regress/sys/kern/pledge/pledgepath/syscalls.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/regress/sys/kern/pledge/pledgepath/syscalls.c b/regress/sys/kern/pledge/pledgepath/syscalls.c index a890724d655..a3366c6da76 100644 --- a/regress/sys/kern/pledge/pledgepath/syscalls.c +++ b/regress/sys/kern/pledge/pledgepath/syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscalls.c,v 1.14 2018/04/26 08:42:42 beck Exp $ */ +/* $OpenBSD: syscalls.c,v 1.15 2018/04/26 08:53:20 beck Exp $ */ /* * Copyright (c) 2017 Bob Beck <beck@openbsd.org> @@ -75,6 +75,10 @@ runcompare(int (*func)(int)) waitpid(pid, &status, 0); if (WIFEXITED(status)) nonppath = WEXITSTATUS(status); + if (WIFSIGNALED(status)) { + printf("[FAIL] nonppath exited with signal %d\n", WTERMSIG(status)); + goto fail; + } pid = fork(); if (pid == 0) { exit(func(1)); @@ -83,12 +87,16 @@ runcompare(int (*func)(int)) waitpid(pid, &status, 0); if (WIFEXITED(status)) ppath = WEXITSTATUS(status); - + if (WIFSIGNALED(status)) { + printf("[FAIL] nonppath exited with signal %d\n", WTERMSIG(status)); + goto fail; + } if (ppath == nonppath) { printf("[SUCCESS] ppath = %d, nonppath = %d\n", ppath, nonppath); return 0; } printf("[FAIL] ppath = %d, nonppath = %d\n", ppath, nonppath); + fail: return 1; } |