need to save errno in case close fails
authorJohn Kohl <jtkohl@mit.edu>
Fri, 31 Aug 1990 15:43:02 +0000 (15:43 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 31 Aug 1990 15:43:02 +0000 (15:43 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1074 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/localaddr.c

index 68bc749f958ad436fdc9916801eb6199bbfca95b..d5fe6ee6c6c9d94d2116c8ee9759524b9575559b 100644 (file)
@@ -97,8 +97,9 @@ krb5_error_code krb5_os_localaddr(addr)
 
     code = ioctl (s, SIOCGIFCONF, (char *)&ifc);
     if (code < 0) {
+       int retval = errno;
        close(s);
-       return errno;
+       return retval;
     }
     n = ifc.ifc_len / sizeof (struct ifreq);