summaryrefslogtreecommitdiffstats
path: root/src/basic/parse-util.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-05-06 07:11:08 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-05-08 09:49:55 +0200
commitd2132d3d8d68e4f5dbe935c8af7a50eb124bcb8e (patch)
treeec6007448f51b50b356fd2116f298327977dab56 /src/basic/parse-util.c
parentzsh: add service-log-{level,target} completions for systemctl (diff)
downloadsystemd-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/basic/parse-util.c')
-rw-r--r--src/basic/parse-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
index d6138f0295..cbe5ad6a32 100644
--- a/src/basic/parse-util.c
+++ b/src/basic/parse-util.c
@@ -343,7 +343,7 @@ int parse_fd(const char *t) {
return r;
if (fd < 0)
- return -ERANGE;
+ return -EBADF;
return fd;
}