diff options
| author | Roy Marples <roy@marples.name> | 2008-07-24 15:09:33 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-07-24 15:09:33 +0000 |
| commit | 318fbafe9e81b35ec47014418c05360448046e0b (patch) | |
| tree | 5398a6401c8c4300584a15265adaed7669a22208 /common.c | |
| parent | 5fa0b31f1008b99c38637cbcccf8233b76e78b9b (diff) | |
| download | dhcpcd-318fbafe9e81b35ec47014418c05360448046e0b.tar.xz | |
Normalise tv_usecs. Also, send the fd ready back to the main loop so we don't have to re-poll each fd. Saves bytes and is more efficient.
Diffstat (limited to 'common.c')
| -rw-r--r-- | common.c | 20 |
1 files changed, 0 insertions, 20 deletions
@@ -33,7 +33,6 @@ #ifdef BSD # include <paths.h> #endif -#include <poll.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -151,25 +150,6 @@ close_fds(void) } int -fd_hasdata(int fd) -{ - struct pollfd fds; - int retval; - - if (fd == -1) - return -1; - fds.fd = fd; - fds.events = POLLIN; - fds.revents = 0; - retval = poll(&fds, 1, 0); - if (retval == -1) - return -1; - if (retval > 0 && fds.revents & POLLIN) - return retval; - return 0; -} - -int set_cloexec(int fd) { int flags; |
