1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-21 02:50:18 +03:00

test: parse_syscall_and_errno() accepts zero errno

This commit is contained in:
Yu Watanabe 2021-03-08 11:10:26 +09:00
parent 17884f979a
commit 335171ca84

View File

@ -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);