]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/sys-linux.c
pppd: Fix variable reference syntax in Makefile.linux
[ppp.git] / pppd / sys-linux.c
index 46e1ed419f4b494fb3d6f4781fdc0120ca808fab..eedcb53b06923d3e39459551b0a2f594d99f8b47 100644 (file)
 #define MAX_ADDR_LEN 7
 #endif
 
-#if __GLIBC__ >= 2
+#if !defined(__GLIBC__) || __GLIBC__ >= 2
 #include <asm/types.h>         /* glibc 2 conflicts with linux/types.h */
 #include <net/if.h>
 #include <net/if_arp.h>
@@ -2167,7 +2167,6 @@ int ppp_available(void)
                }
            }
 
-           close (s);
            if (!ok) {
                slprintf(route_buffer, sizeof(route_buffer),
                         "Sorry - PPP driver version %d.%d.%d is out of date\n",
@@ -2177,6 +2176,7 @@ int ppp_available(void)
            }
        }
     }
+    close(s);
     return ok;
 }
 
@@ -2653,7 +2653,10 @@ get_pty(master_fdp, slave_fdp, slave_name, uid)
                warn("Couldn't unlock pty slave %s: %m", pty_name);
 #endif
            if ((sfd = open(pty_name, O_RDWR | O_NOCTTY)) < 0)
+           {
                warn("Couldn't open pty slave %s: %m", pty_name);
+               close(mfd);
+           }
        }
     }
 #endif /* TIOCGPTN */