From 968d3d242cc9256eaca9a18155a744b575159cbd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 27 Jan 2014 20:12:14 +0100 Subject: resolve: update sd-resolve to match the other APIs in style and functionality --- src/shared/util.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/shared/util.c') diff --git a/src/shared/util.c b/src/shared/util.c index 5551714a36..cdd9a48866 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -3869,13 +3869,16 @@ int pipe_eof(int fd) { } int fd_wait_for_event(int fd, int event, usec_t t) { - int r; + struct pollfd pollfd = { .fd = fd, .events = event, }; - r = poll(&pollfd, 1, t == (usec_t) -1 ? -1 : (int) (t / USEC_PER_MSEC)); + struct timespec ts; + int r; + + r = ppoll(&pollfd, 1, t == (usec_t) -1 ? NULL : timespec_store(&ts, t), NULL); if (r < 0) return -errno; -- cgit v1.2.3-54-g00ecf