projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17884f9
)
test: parse_syscall_and_errno() accepts zero errno
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Mon, 8 Mar 2021 02:10:26 +0000
(11:10 +0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Mon, 8 Mar 2021 12:22:24 +0000
(21:22 +0900)
src/test/test-seccomp.c
patch
|
blob
|
history
diff --git
a/src/test/test-seccomp.c
b/src/test/test-seccomp.c
index 6aa91ae8ecb34c01f8341e1d14810a4d3872f19d..b1f917eb54e2503f1dadeff43fdcd5a333355a13 100644
(file)
--- a/
src/test/test-seccomp.c
+++ b/
src/test/test-seccomp.c
@@
-72,6
+72,12
@@
static void test_parse_syscall_and_errno(void) {
assert_se(e == 255);
n = mfree(n);
+ /* 0 is also a valid errno. */
+ assert_se(parse_syscall_and_errno("hoge:0", &n, &e) >= 0);
+ assert_se(streq(n, "hoge"));
+ assert_se(e == 0);
+ n = mfree(n);
+
assert_se(parse_syscall_and_errno("hoge:kill", &n, &e) >= 0);
assert_se(streq(n, "hoge"));
assert_se(e == SECCOMP_ERROR_NUMBER_KILL);