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 for754d8b9c33ande652663a04.
This commit is contained in:
committed by
Daan De Meyer
parent
b3d12ac0da
commit
d2132d3d8d
+1
-3
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user