return r;
if (fd < 0)
- return -ERANGE;
+ return -EBADF;
return fd;
}
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);
int fdnr;
fdnr = parse_fd(optarg);
- if (fdnr == -ERANGE)
- return log_error_errno(fdnr, "File descriptor can't be negative: %s", optarg);
if (fdnr < 0)
return log_error_errno(fdnr, "Failed to parse file descriptor: %s", optarg);
return -EINVAL;
ifd = parse_fd(sfd);
- if (ifd == -ERANGE)
- return -EBADF;
if (ifd < 0)
return r;
buf = strndupa_safe(v, n);
fd = parse_fd(buf);
- if (fd == -ERANGE)
- return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
- "VarlinkServerSocket varlink-server-socket-fd= has an invalid value: %s", buf);
if (fd < 0)
return log_debug_errno(fd, "Unable to parse VarlinkServerSocket varlink-server-socket-fd=%s: %m", buf);
if (!fdset_contains(fds, 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);