diff options
author | peter <peter@FreeBSD.org> | 1998-06-14 11:25:46 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-06-14 11:25:46 +0000 |
commit | 7321b44b39b5b8d73378f7c295c2508f5d73a09a (patch) | |
tree | 1f6502b4108d83c3369ed110c44fe30edb83dc4b /lib/libc/net/res_send.c | |
parent | f38597edce3bcec6507debd9e0984d84cd2a8874 (diff) | |
download | FreeBSD-src-7321b44b39b5b8d73378f7c295c2508f5d73a09a.zip FreeBSD-src-7321b44b39b5b8d73378f7c295c2508f5d73a09a.tar.gz |
Don't compile in the use of poll() when building libc_r. This isn't
so much a "fix", rather a bandaid to buy time to fix it properly
within the thread engine.
Diffstat (limited to 'lib/libc/net/res_send.c')
-rw-r--r-- | lib/libc/net/res_send.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c index 45c9661..c06e26a 100644 --- a/lib/libc/net/res_send.c +++ b/lib/libc/net/res_send.c @@ -71,7 +71,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; static char orig_rcsid[] = "From: Id: res_send.c,v 8.20 1998/04/06 23:27:51 halley Exp $"; -static char rcsid[] = "$Id: res_send.c,v 1.22 1998/05/02 15:51:54 peter Exp $"; +static char rcsid[] = "$Id: res_send.c,v 1.23 1998/06/11 09:03:01 peter Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -99,8 +99,12 @@ static char rcsid[] = "$Id: res_send.c,v 1.22 1998/05/02 15:51:54 peter Exp $"; #include "res_config.h" +#ifdef NOPOLL /* libc_r doesn't wrap poll yet() */ +static int use_poll = 0; +#else static int use_poll = 1; /* adapt to poll() syscall availability */ /* 0 = not present, 1 = try it, 2 = exists */ +#endif static int s = -1; /* socket used for communications */ static int connected = 0; /* is the socket connected */ @@ -519,8 +523,10 @@ read_len: /* * Use datagrams. */ +#ifndef NOPOLL struct pollfd pfd; int msec; +#endif struct timeval timeout; fd_set dsmask, *dsmaskp; int dsmasklen; @@ -626,6 +632,7 @@ read_len: /* * Wait for reply */ +#ifndef NOPOLL othersyscall: if (use_poll) { msec = (_res.retrans << try) * 1000; @@ -634,19 +641,23 @@ read_len: if (msec <= 0) msec = 1000; } else { +#endif timeout.tv_sec = (_res.retrans << try); if (try > 0) timeout.tv_sec /= _res.nscount; if ((long) timeout.tv_sec <= 0) timeout.tv_sec = 1; timeout.tv_usec = 0; +#ifndef NOPOLL } +#endif wait: if (s < 0) { Perror(stderr, "s out-of-bounds", EMFILE); res_close(); goto next_ns; } +#ifndef NOPOLL if (use_poll) { struct sigaction sa, osa; int sigsys_installed = 0; @@ -680,6 +691,7 @@ read_len: goto next_ns; } } else { +#endif dsmasklen = howmany(s + 1, NFDBITS) * sizeof(fd_mask); if (dsmasklen > sizeof(fd_set)) { @@ -704,7 +716,9 @@ read_len: res_close(); goto next_ns; } +#ifndef NOPOLL } +#endif if (n == 0) { /* |