summaryrefslogtreecommitdiffstats
path: root/src/test/test-util.c
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2018-05-31 05:06:33 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-06-02 09:48:19 +0200
commit96f64eb5741b157f26a9089816fdd992e959792e (patch)
treed1f07b373b14f63a574fb19ea93340bafa13693f /src/test/test-util.c
parentMerge pull request #9018 from poettering/get-process-comm-is-print (diff)
downloadsystemd-96f64eb5741b157f26a9089816fdd992e959792e.tar.xz
systemd-96f64eb5741b157f26a9089816fdd992e959792e.zip
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 '')
-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 92d2c77690..af0ada7d2a 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -214,6 +214,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);
}
static void test_physical_memory(void) {