]> Savannah Git Hosting - gnulib.git/commitdiff
closedir, dirfd, opendir: port to OpenSolaris 5.10
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 24 Jan 2016 08:28:19 +0000 (00:28 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 24 Jan 2016 08:28:53 +0000 (00:28 -0800)
* m4/closedir.m4 (gl_FUNC_CLOSEDIR):
* m4/dirfd.m4 (gl_FUNC_DIRFD):
* m4/opendir.m4 (gl_FUNC_OPENDIR):
Don't use ${word##pat} substitution, as it doesn't work in
OpenSolaris 5.10 /bin/sh.  Problem reported by Assaf Gordon in:
http://bugs.gnu.org/22443#11

ChangeLog
m4/closedir.m4
m4/dirfd.m4
m4/opendir.m4

index 839c22265d0efcd36fad75aa7e34e920ada3a0e4..2da850ccd0ff9421fe975949538293c321f57c9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2016-01-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+       closedir, dirfd, opendir: port to OpenSolaris 5.10
+       * m4/closedir.m4 (gl_FUNC_CLOSEDIR):
+       * m4/dirfd.m4 (gl_FUNC_DIRFD):
+       * m4/opendir.m4 (gl_FUNC_OPENDIR):
+       Don't use ${word##pat} substitution, as it doesn't work in
+       OpenSolaris 5.10 /bin/sh.  Problem reported by Assaf Gordon in:
+       http://bugs.gnu.org/22443#11
+
 2016-01-23  Paul Eggert  <eggert@cs.ucla.edu>
 
        bootstrap: use American spelling
index 15a5cc8a493f6913c224382fb1457a50ddd99703..e679694557d7ddc200461a2bb30001035154f004 100644 (file)
@@ -1,4 +1,4 @@
-# closedir.m4 serial 3
+# closedir.m4 serial 4
 dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -23,9 +23,8 @@ AC_DEFUN([gl_FUNC_CLOSEDIR],
     fi
   ])
   dnl Replace closedir() for supporting the gnulib-defined dirfd() function.
-  if test -z "${host_os##os2*}"; then
-    if test $HAVE_OPENDIR = 1; then
-      REPLACE_OPENDIR=1
-    fi
-  fi
+  case $host_os,$HAVE_OPENDIR in
+    os2,1)
+      REPLACE_OPENDIR=1;;
+  esac
 ])
index 758fed0c6eb2ce89e8db55cfe6fda235d97b9d11..1d7cb080d8e8b1a00d4bde1597295ca158f7d717 100644 (file)
@@ -1,4 +1,4 @@
-# serial 23   -*- Autoconf -*-
+# serial 24   -*- Autoconf -*-
 
 dnl Find out how to get the file descriptor associated with an open DIR*.
 
@@ -37,15 +37,13 @@ AC_DEFUN([gl_FUNC_DIRFD],
 
   # Use the replacement if we have no function or macro with that name,
   # or if OS/2 kLIBC whose dirfd() does not work.
-  if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
-     || test -z "${host_os##os2*}" ; then
-    if test $ac_cv_have_decl_dirfd = yes; then
-      # If the system declares dirfd already, let's declare rpl_dirfd instead.
+  # Replace only if the system declares dirfd already.
+  case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
+    no,no,*,yes | *,*,os2*,yes)
       REPLACE_DIRFD=1
       AC_DEFINE([REPLACE_DIRFD], [1],
-        [Define to 1 if gnulib's dirfd() replacement is used.])
-    fi
-  fi
+        [Define to 1 if gnulib's dirfd() replacement is used.]);;
+  esac
 ])
 
 dnl Prerequisites of lib/dirfd.c.
index 2124f9890dedc93a8cb7bb7db7ea925cd8410508..ffaa6ae3baa53fe8d0675e698f66fc68bbd9bb6c 100644 (file)
@@ -1,4 +1,4 @@
-# opendir.m4 serial 3
+# opendir.m4 serial 4
 dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -24,9 +24,8 @@ AC_DEFUN([gl_FUNC_OPENDIR],
   ])
   dnl Replace opendir() on OS/2 kLIBC to support dirfd() function replaced
   dnl by gnulib.
-  if test -z "${host_os##os2*}"; then
-    if test $HAVE_OPENDIR = 1; then
-      REPLACE_OPENDIR=1
-    fi
-  fi
+  case $host_os,$HAVE_OPENDIR in
+    os2*,1)
+      REPLACE_OPENDIR=1;;
+  esac
 ])