diff options
author | Peter Wemm <peter@FreeBSD.org> | 1998-05-02 15:51:54 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1998-05-02 15:51:54 +0000 |
commit | 9e397145183c46c391ee06f3838b24dbcb5fa7a5 (patch) | |
tree | 49fd61807e220a411d19bdf7388bfbe6df900302 /lib/libc/net | |
parent | c8d2fd6da848f194d98bdbc098f4cf25c50339e4 (diff) | |
download | src-9e397145183c46c391ee06f3838b24dbcb5fa7a5.tar.gz src-9e397145183c46c391ee06f3838b24dbcb5fa7a5.zip |
Resolve some unexpected differences when comparing with the 2.2 version.
One bug was relatively harmless (select's timeout had an uninitialized
tv_usec), the other I'm not so sure.. (neglected to catch select returns
less than zero). Both of these were irrelevant on kernels with poll().
Notes
Notes:
svn path=/head/; revision=35624
Diffstat (limited to 'lib/libc/net')
-rw-r--r-- | lib/libc/net/res_send.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c index b8acbfd72ea9..a29f43a6f508 100644 --- a/lib/libc/net/res_send.c +++ b/lib/libc/net/res_send.c @@ -56,7 +56,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.14 1998/04/07 04:59:46 vixie Exp $"; -static char rcsid[] = "$Id: res_send.c,v 1.20 1997/09/16 06:03:54 peter Exp $"; +static char rcsid[] = "$Id: res_send.c,v 1.21 1998/05/02 13:11:02 peter Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -607,11 +607,12 @@ read_len: if (msec <= 0) msec = 1000; } else { - timeout.tv_sec = (_res.retrans << try); + 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; } wait: if (s < 0) { @@ -669,6 +670,13 @@ read_len: (fd_set *)NULL, &timeout); if (dsmaskp != &dsmask) free(dsmaskp); + if (n < 0) { + if (errno == EINTR) + goto wait; + Perror(stderr, "select", errno); + res_close(); + goto next_ns; + } } if (n == 0) { |