summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-05-06 14:11:08 +0900
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-05-08 09:49:55 +0200
commitd2132d3d8d68e4f5dbe935c8af7a50eb124bcb8e (patch)
treeec6007448f51b50b356fd2116f298327977dab56 /src/core
parentb3d12ac0da2a8b25abc9052a4f350f1ea1108985 (diff)
downloadsystemd-d2132d3d8d68e4f5dbe935c8af7a50eb124bcb8e.tar.gz
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/core')
-rw-r--r--src/core/main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c
index f36f6c4c9e..5274bcc106 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1003,10 +1003,8 @@ static int parse_argv(int argc, char *argv[]) {
FILE *f;
fd = parse_fd(optarg);
- if (fd == -ERANGE)
- return log_error_errno(fd, "Invalid serialization fd: %s", optarg);
if (fd < 0)
- return log_error_errno(fd, "Failed to parse deserialize option \"%s\": %m", optarg);
+ return log_error_errno(fd, "Failed to parse serialization fd \"%s\": %m", optarg);
(void) fd_cloexec(fd, true);