From f020c14e4f1eb6b643ff673d0b5c35bc41fd4595 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 27 Apr 2006 23:24:34 +0000 Subject: * implement a "minimal" mode * add configure option to allow building of nss-mdns without legacy mDNS queries git-svn-id: file:///home/lennart/svn/public/nss-mdns/trunk@91 0ee8848e-81ea-0310-a63a-f631d1a40d77 --- src/util.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index bf37711..1d0cd90 100644 --- a/src/util.c +++ b/src/util.c @@ -31,6 +31,8 @@ #include "util.h" +#ifdef ENABLE_LEGACY + /* Calculate the difference between the two specfified timeval * timestamsps. */ usec_t timeval_diff(const struct timeval *a, const struct timeval *b) { @@ -102,19 +104,6 @@ void timeval_add(struct timeval *tv, usec_t v) { } } -int set_cloexec(int fd) { - int n; - assert(fd >= 0); - - if ((n = fcntl(fd, F_GETFD)) < 0) - return -1; - - if (n & FD_CLOEXEC) - return 0; - - return fcntl(fd, F_SETFD, n|FD_CLOEXEC); -} - int set_nonblock(int fd) { int n; assert(fd >= 0); @@ -203,3 +192,18 @@ int wait_for_read(int fd, struct timeval *end) { } } +#endif + +int set_cloexec(int fd) { + int n; + assert(fd >= 0); + + if ((n = fcntl(fd, F_GETFD)) < 0) + return -1; + + if (n & FD_CLOEXEC) + return 0; + + return fcntl(fd, F_SETFD, n|FD_CLOEXEC); +} + -- cgit