uds: Convey transmit path errors to the caller.
The transport layer's functional interface foresees having error codes percolate back up to the caller. However, up until now, the uds module simply returned -1 for any error. This patch lets the code return the specific error instead. In addition, it removes the gratuitous printing of the error message, leaving that task up to caller, just like the other transport modules. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
b2bf55aebd
commit
0d82c41ac1
5
uds.c
5
uds.c
|
@ -119,8 +119,8 @@ static int uds_send(struct transport *t, struct fdarray *fda,
|
||||||
addr = &uds->address;
|
addr = &uds->address;
|
||||||
|
|
||||||
cnt = sendto(fd, buf, buflen, 0, &addr->sa, addr->len);
|
cnt = sendto(fd, buf, buflen, 0, &addr->sa, addr->len);
|
||||||
if (cnt <= 0 && errno != ECONNREFUSED) {
|
if (cnt < 1) {
|
||||||
pr_err("uds: sendto failed: %m");
|
return -errno;
|
||||||
}
|
}
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
@ -144,4 +144,3 @@ struct transport *uds_transport_create(void)
|
||||||
uds->t.release = uds_release;
|
uds->t.release = uds_release;
|
||||||
return &uds->t;
|
return &uds->t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue