From e7cc6f7d0b86d76963058ef099ca553da29d2c3f Mon Sep 17 00:00:00 2001 From: Christophe GRENIER Date: Sat, 16 Feb 2008 12:10:56 +0100 Subject: [PATCH] Add portability checks to support DJGPP DJGPP lacks sys/select.h and sys/un.h; add header checks to be more portable. Signed-off-by: Christophe Grenier Signed-off-by: Theodore Ts'o --- configure | 4 +++- configure.in | 2 +- lib/ext2fs/tdb.c | 2 ++ lib/uuid/gen_uuid.c | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configure b/configure index b569dd8..623788b 100755 --- a/configure +++ b/configure @@ -11785,7 +11785,9 @@ fi -for ac_header in stdlib.h unistd.h stdarg.h stdint.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disklabel.h sys/ioctl.h sys/mman.h sys/mkdev.h sys/prctl.h sys/queue.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h sys/syscall.h net/if_dl.h netinet/in.h utime.h + + +for ac_header in dirent.h errno.h getopt.h malloc.h mntent.h paths.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h unistd.h utime.h linux/fd.h linux/major.h net/if_dl.h netinet/in.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mman.h sys/prctl.h sys/queue.h sys/resource.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/syscall.h sys/sysmacros.h sys/time.h sys/types.h sys/un.h sys/wait.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then diff --git a/configure.in b/configure.in index 5a9dead..333d158 100644 --- a/configure.in +++ b/configure.in @@ -623,7 +623,7 @@ if test $cross_compiling = no; then else AC_CHECK_PROGS(BUILD_CC, gcc cc) fi -AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h stdint.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disklabel.h sys/ioctl.h sys/mman.h sys/mkdev.h sys/prctl.h sys/queue.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h sys/syscall.h net/if_dl.h netinet/in.h utime.h) +AC_CHECK_HEADERS(dirent.h errno.h getopt.h malloc.h mntent.h paths.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h unistd.h utime.h linux/fd.h linux/major.h net/if_dl.h netinet/in.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mman.h sys/prctl.h sys/queue.h sys/resource.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/syscall.h sys/sysmacros.h sys/time.h sys/types.h sys/un.h sys/wait.h) AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,, [[ #if HAVE_SYS_QUEUE_H diff --git a/lib/ext2fs/tdb.c b/lib/ext2fs/tdb.c index 6f6018b..822817b 100644 --- a/lib/ext2fs/tdb.c +++ b/lib/ext2fs/tdb.c @@ -45,7 +45,9 @@ Last Changed: 2007-04-03 05:08:18 -0400 #include #include #include +#ifdef HAVE_SYS_SELECT_H #include +#endif #include #include #include diff --git a/lib/uuid/gen_uuid.c b/lib/uuid/gen_uuid.c index d4befe4..cf2b5a6 100644 --- a/lib/uuid/gen_uuid.c +++ b/lib/uuid/gen_uuid.c @@ -59,7 +59,9 @@ #ifdef HAVE_SYS_SOCKET_H #include #endif +#ifdef HAVE_SYS_UN_H #include +#endif #ifdef HAVE_SYS_SOCKIO_H #include #endif @@ -393,7 +395,7 @@ static ssize_t read_all(int fd, char *buf, size_t count) */ static int get_uuid_via_daemon(int op, uuid_t out, int *num) { -#ifdef USE_UUIDD +#if defined(USE_UUIDD) && defined(HAVE_SYS_UN_H) char op_buf[64]; int op_len; int s; -- 1.8.3.1