summaryrefslogtreecommitdiff
path: root/src/test/test-util.c
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2018-05-30 23:06:33 -0400
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit1f59c3b65eadaf1fed2b037e78b0913f85c0a717 (patch)
tree6a2766dd9b2e577b1d82f5659022c9feafd19b0d /src/test/test-util.c
parentbbc6a6a0caba41c00c1dfd9a01c7129efaa5fe56 (diff)
basic: set errno in raw_clone() on sparc
sparc sets the carry bit when a syscall fails. Use this information to set errno and return -1 as appropriate. The added test case calls raw_clone() with flags known to be invalid according to the clone(2) manpage.
Diffstat (limited to 'src/test/test-util.c')
-rw-r--r--src/test/test-util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 9d31d5a86..d82580079 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -215,6 +215,10 @@ static void test_raw_clone(void) {
waitpid(pid, &status, __WCLONE);
assert_se(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS);
}
+
+ errno = 0;
+ assert_se(raw_clone(CLONE_FS|CLONE_NEWNS) == -1);
+ assert_se(errno == EINVAL);
}
#endif // 0