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
@@ -450,8 +450,6 @@ int bpf_program_deserialize_attachment(const char *v, FDSet *fds, BPFProgram **b
|
||||
return -EINVAL;
|
||||
|
||||
ifd = parse_fd(sfd);
|
||||
if (ifd == -ERANGE)
|
||||
return -EBADF;
|
||||
if (ifd < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -3061,9 +3061,6 @@ int varlink_server_deserialize_one(VarlinkServer *s, const char *value, FDSet *f
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user