From 737d6ff89b534bf9e57309e06b982b614d05e9e3 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Mon, 13 Oct 2014 08:39:08 -0400 Subject: src/shared/util.c: final cosmetic change Signed-off-by: Anthony G. Basile --- src/shared/util.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/shared') diff --git a/src/shared/util.c b/src/shared/util.c index 5ad206a6c2..691a876872 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -829,6 +829,26 @@ bool nulstr_contains(const char*nulstr, const char *needle) { return false; } +int fd_wait_for_event(int fd, int event, usec_t t) { + + struct pollfd pollfd = { + .fd = fd, + .events = event, + }; + + struct timespec ts; + int r; + + r = ppoll(&pollfd, 1, t == USEC_INFINITY ? NULL : timespec_store(&ts, t), NULL); + if (r < 0) + return -errno; + + if (r == 0) + return 0; + + return pollfd.revents; +} + int fopen_temporary(const char *path, FILE **_f, char **_temp_path) { FILE *f; char *t; @@ -1190,26 +1210,6 @@ const char *signal_to_string(int signo) { return buf; } -int fd_wait_for_event(int fd, int event, usec_t t) { - - struct pollfd pollfd = { - .fd = fd, - .events = event, - }; - - struct timespec ts; - int r; - - r = ppoll(&pollfd, 1, t == USEC_INFINITY ? NULL : timespec_store(&ts, t), NULL); - if (r < 0) - return -errno; - - if (r == 0) - return 0; - - return pollfd.revents; -} - int fd_inc_sndbuf(int fd, size_t n) { int r, value; socklen_t l = sizeof(value); -- cgit v1.2.3-54-g00ecf