mirror of
https://github.com/troglobit/finit.git
synced 2026-10-25 12:04:36 +00:00
initctl: drop confusing 'errno 0' from "Timed out" message
errno is not set when we timeout waiting for a reply from Finit. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
4362971c6a
commit
0acbc60ec1
1 file changed
+6
-2
+6
-2
@@ -67,6 +67,7 @@ int client_send(struct init_request *rq, ssize_t len)
|
|||||||
{
|
{
|
||||||
struct pollfd pfd = { 0 };
|
struct pollfd pfd = { 0 };
|
||||||
int sd, result = 255;
|
int sd, result = 255;
|
||||||
|
int rc;
|
||||||
|
|
||||||
sd = client_connect();
|
sd = client_connect();
|
||||||
if (-1 == sd)
|
if (-1 == sd)
|
||||||
@@ -86,8 +87,11 @@ int client_send(struct init_request *rq, ssize_t len)
|
|||||||
|
|
||||||
pfd.fd = sd;
|
pfd.fd = sd;
|
||||||
pfd.events = POLLIN;
|
pfd.events = POLLIN;
|
||||||
if (poll(&pfd, 1, 2000) <= 0) {
|
if ((rc = poll(&pfd, 1, 2000)) <= 0) {
|
||||||
warn("Timed out waiting for reply from Finit, errno %d", errno);
|
if (rc)
|
||||||
|
warn("poll(), errno %d", errno);
|
||||||
|
else
|
||||||
|
warnx("Timed out waiting for reply from Finit.");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user