From: Lennart Poettering Date: Mon, 27 Nov 2017 15:28:53 +0000 (+0100) Subject: sd-resolve: propagate timeouts in sd_resolve_wait() the same way as in sd_bus_wait... X-Git-Tag: v236~104^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=971fea32035b642eda6154ef963a6269e9d271ec;p=thirdparty%2Fsystemd.git sd-resolve: propagate timeouts in sd_resolve_wait() the same way as in sd_bus_wait(): ETIMEDOUT Thankfully this is an internal API still, so we can mkae changes like this. --- diff --git a/src/basic/io-util.c b/src/basic/io-util.c index 98bb1857d97..77c9bdc739d 100644 --- a/src/basic/io-util.c +++ b/src/basic/io-util.c @@ -200,7 +200,6 @@ int fd_wait_for_event(int fd, int event, usec_t t) { r = ppoll(&pollfd, 1, t == USEC_INFINITY ? NULL : timespec_store(&ts, t), NULL); if (r < 0) return -errno; - if (r == 0) return 0; diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c index 986768e7b39..61a0a4c1de6 100644 --- a/src/libsystemd/sd-resolve/sd-resolve.c +++ b/src/libsystemd/sd-resolve/sd-resolve.c @@ -890,6 +890,8 @@ _public_ int sd_resolve_wait(sd_resolve *resolve, uint64_t timeout_usec) { if (r < 0) return r; + if (r == 0) + return -ETIMEDOUT; return sd_resolve_process(resolve); }