diff options
author | Phil Blundell <philb@gnu.org> | 2001-02-12 21:06:47 +0000 |
---|---|---|
committer | Phil Blundell <philb@gnu.org> | 2001-02-12 21:06:47 +0000 |
commit | e9000a9b4aba229a57a8b36aba4a7880eb5356a1 (patch) | |
tree | b540e0010d40e1d823c3949a21471b8b4b2fe51b /ifconfig.c | |
parent | Make packet/byte counters 64 bits wide (diff) | |
download | net-tools-e9000a9b4aba229a57a8b36aba4a7880eb5356a1.tar.gz net-tools-e9000a9b4aba229a57a8b36aba4a7880eb5356a1.tar.bz2 net-tools-e9000a9b4aba229a57a8b36aba4a7880eb5356a1.zip |
Avoid closing a socket we're about to use.
Diffstat (limited to 'ifconfig.c')
-rw-r--r-- | ifconfig.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } } |