]> err.no Git - util-linux/commitdiff
portability: fix mntent.h and pty.h usage
authorFrançois Revol <revol@free.fr>
Mon, 26 Jul 2010 09:43:51 +0000 (11:43 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 26 Jul 2010 09:43:51 +0000 (11:43 +0200)
Signed-off-by: François Revol <revol@free.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/ismounted.c
misc-utils/script.c

index fa7e822528ee5550f206bac564120027bc989570..592df30863392c7e63f80a72219f85e069031550 100644 (file)
 #include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
+#if HAVE_MNTENT_H
 #include <mntent.h>
+#endif
 #include <string.h>
 #include <sys/stat.h>
 #include <ctype.h>
 #include <sys/param.h>
+#ifdef __APPLE__
+#include <sys/ucred.h>
+#include <sys/mount.h>
+#endif
 
 #include "pathnames.h"
 #include "ismounted.h"
index 2028db664eba2b26b1ffa9547af05ed96807cc7a..9367fafbcf899875cdea894bd2f93c74eff5fd6c 100644 (file)
@@ -59,7 +59,7 @@
 
 #include "nls.h"
 
-#ifdef HAVE_LIBUTIL
+#if HAVE_LIBUTIL && HAVE_PTY_H
 #include <pty.h>
 #endif
 
@@ -91,7 +91,7 @@ struct        termios tt;
 struct winsize win;
 int    lb;
 int    l;
-#ifndef HAVE_LIBUTIL
+#if !HAVE_LIBUTIL || !HAVE_PTY_H
 char   line[] = "/dev/ptyXX";
 #endif
 int    aflg = 0;
@@ -467,7 +467,7 @@ done() {
 
 void
 getmaster() {
-#ifdef HAVE_LIBUTIL
+#if HAVE_LIBUTIL && HAVE_PTY_H
        (void) tcgetattr(0, &tt);
        (void) ioctl(0, TIOCGWINSZ, (char *)&win);
        if (openpty(&master, &slave, NULL, &tt, &win) < 0) {