Avoid closing a socket we're about to use.
authorPhil Blundell <philb@gnu.org>
Mon, 12 Feb 2001 21:06:47 +0000 (21:06 +0000)
committerPhil Blundell <philb@gnu.org>
Mon, 12 Feb 2001 21:06:47 +0000 (21:06 +0000)
Makefile
README
ifconfig.c

index 4b593a8..abbeaa9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -101,7 +101,7 @@ endif
 # -------- end of user definitions --------
 
 MAINTAINER = Philip.Blundell@pobox.com
-RELEASE           = 1.58
+RELEASE           = 1.59
 
 .EXPORT_ALL_VARIABLES:
 
diff --git a/README b/README
index be63692..c2848e3 100644 (file)
--- a/README
+++ b/README
@@ -32,7 +32,7 @@ Contents:
                           Notes
                           -----
 
-This is net-tools 1.58.
+This is net-tools 1.59.
 
 You need kernel 2.0 or later to use these programs.  These programs
 should compile cleanly with both glibc (version 2.0 or 2.1) and libc5,
index fc83bbd..74b9e9c 100644 (file)
@@ -3,7 +3,7 @@
  *              that either displays or sets the characteristics of
  *              one or more of the system's networking interfaces.
  *
- * Version:     $Id: ifconfig.c,v 1.43 2000/10/26 03:19:06 ak Exp $
+ * Version:     $Id: ifconfig.c,v 1.44 2001/02/12 21:06:47 pb Exp $
  *
  * Author:      Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  *              and others.  Copyright 1993 MicroWalt Corporation
@@ -312,13 +312,13 @@ int main(int argc, char **argv)
     else 
        ap = get_aftype(DFLT_AF);
        
-    if(ap) {
+    if (ap) {
        addr_family = ap->af;
        if ((fd=sockets_open(addr_family)) < 0) {
                perror("family socket");
                exit(1);
        } else {
-               if (skfd) close(skfd);
+               if (skfd > 0 && skfd != fd) close(skfd);
                skfd = fd;
        }
     }