resolve: update sd-resolve to match the other APIs in style and functionality

This commit is contained in:
Lennart Poettering
2014-01-27 20:12:59 +01:00
parent ff975efb2e
commit 968d3d242c
6 changed files with 717 additions and 594 deletions
+5 -2
View File
@@ -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;