diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-05-06 07:11:08 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-05-08 09:49:55 +0200 |
commit | d2132d3d8d68e4f5dbe935c8af7a50eb124bcb8e (patch) | |
tree | ec6007448f51b50b356fd2116f298327977dab56 /src/test | |
parent | zsh: add service-log-{level,target} completions for systemctl (diff) | |
download | systemd-d2132d3d8d68e4f5dbe935c8af7a50eb124bcb8e.tar.xz systemd-d2132d3d8d68e4f5dbe935c8af7a50eb124bcb8e.zip |
parse-util: make parse_fd() return -EBADF
The previous error code -ERANGE is slightly ambiguous, and use more
specific one. This also drops unnecessary error handlings.
Follow-up for 754d8b9c330150fdb3767491e24975f7dfe2a203 and
e652663a043cb80936bb12ad5c87766fc5150c24.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-parse-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c index 75fc3d9455..1ba8c8987f 100644 --- a/src/test/test-parse-util.c +++ b/src/test/test-parse-util.c @@ -869,8 +869,8 @@ TEST(parse_fd) { assert_se(parse_fd("0") == 0); assert_se(parse_fd("1") == 1); - assert_se(parse_fd("-1") == -ERANGE); - assert_se(parse_fd("-3") == -ERANGE); + assert_se(parse_fd("-1") == -EBADF); + assert_se(parse_fd("-3") == -EBADF); assert_se(parse_fd("") == -EINVAL); assert_se(parse_fd("12.3") == -EINVAL); |