emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r118155: Merge from gnulib.


From: Paul Eggert
Subject: [Emacs-diffs] trunk r118155: Merge from gnulib.
Date: Sun, 19 Oct 2014 06:33:50 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118155
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sat 2014-10-18 23:33:40 -0700
message:
  Merge from gnulib.
  
  This incorporates:
  2014-10-18 readlinkat: port to AIX 7.1
  2014-10-07 fcntl: fix error reporting by dupfd
  * lib/fcntl.c, lib/readlinkat.c, lib/unistd.in.h, m4/readlinkat.m4:
  * m4/unistd_h.m4: Update from gnulib.
  * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
modified:
  ChangeLog                      changelog-20091113204419-o5vbwnq5f7feedwu-1538
  lib/fcntl.c                    fcntl.c-20130707175726-ax31vjqobh17obwz-1
  lib/gnulib.mk                  gnulib.mk-20110108211121-3ig4un4ogtyyca3s-7
  lib/readlinkat.c               readlinkat.c-20130201062823-w76pgdl107cutopz-8
  lib/unistd.in.h                unistd.in.h-20110109071402-7rc382anf65r2ire-6
  m4/gnulib-comp.m4              glcomp.m4-20110127072028-6mkjqxjzdsx0wp15-1
  m4/readlinkat.m4               
readlinkat.m4-20130201062823-w76pgdl107cutopz-14
  m4/unistd_h.m4                 unistd_h.m4-20110109071402-7rc382anf65r2ire-7
=== modified file 'ChangeLog'
--- a/ChangeLog 2014-10-17 18:05:48 +0000
+++ b/ChangeLog 2014-10-19 06:33:40 +0000
@@ -1,3 +1,12 @@
+2014-10-19  Paul Eggert  <address@hidden>
+
+       Merge from gnulib, incorporating:
+       2014-10-18 readlinkat: port to AIX 7.1
+       2014-10-07 fcntl: fix error reporting by dupfd
+       * lib/fcntl.c, lib/readlinkat.c, lib/unistd.in.h, m4/readlinkat.m4:
+       * m4/unistd_h.m4: Update from gnulib.
+       * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
+
 2014-10-17  Glenn Morris  <address@hidden>
 
        * configure.ac: Simplify OS X $canonical tests.

=== modified file 'lib/fcntl.c'
--- a/lib/fcntl.c       2014-01-01 07:43:34 +0000
+++ b/lib/fcntl.c       2014-10-19 06:33:40 +0000
@@ -89,8 +89,25 @@
                             inherit,                /* InheritHandle */
                             DUPLICATE_SAME_ACCESS)) /* Options */
         {
-          /* TODO: Translate GetLastError () into errno.  */
-          errno = EMFILE;
+          switch (GetLastError ())
+            {
+              case ERROR_TOO_MANY_OPEN_FILES:
+                errno = EMFILE;
+                break;
+              case ERROR_INVALID_HANDLE:
+              case ERROR_INVALID_TARGET_HANDLE:
+              case ERROR_DIRECT_ACCESS_HANDLE:
+                errno = EBADF;
+                break;
+              case ERROR_INVALID_PARAMETER:
+              case ERROR_INVALID_FUNCTION:
+              case ERROR_INVALID_ACCESS:
+                errno = EINVAL;
+                break;
+              default:
+                errno = EACCES;
+                break;
+            }
           result = -1;
           break;
         }
@@ -98,7 +115,6 @@
       if (duplicated_fd < 0)
         {
           CloseHandle (new_handle);
-          errno = EMFILE;
           result = -1;
           break;
         }

=== modified file 'lib/gnulib.mk'
--- a/lib/gnulib.mk     2014-08-30 22:59:39 +0000
+++ b/lib/gnulib.mk     2014-10-19 06:33:40 +0000
@@ -21,7 +21,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib 
--m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux 
--avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix 
--avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die 
--avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select 
--avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib 
--makefile-name=gnulib.mk --conditional-dependencies --no-libtool 
--macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase 
careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 
crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ 
execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync 
getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat 
manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl 
readlink readlinkat sig2str socklen stat-time stdalign stdio strftime strtoimax 
strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub 
unsetenv update-copyright utimens vla warnings
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib 
--m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux 
--avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix 
--avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die 
--avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select 
--avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib 
--makefile-name=gnulib.mk --conditional-dependencies --no-libtool 
--macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase 
careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 
crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ 
execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync 
getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat 
manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl 
readlink readlinkat sig2str socklen stat-time stdalign stdio strftime strtoimax 
strtoumax symlink sys_stat sys_time time time_r timer-time timespec-add 
timespec-sub unsetenv update-copyright utimens vla warnings
 
 
 MOSTLYCLEANFILES += core *.stackdump
@@ -1748,9 +1748,11 @@
              -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
              -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
              -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
+             -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
              -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+             -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
              -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
              -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
              -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \

=== modified file 'lib/readlinkat.c'
--- a/lib/readlinkat.c  2014-01-01 07:43:34 +0000
+++ b/lib/readlinkat.c  2014-10-19 06:33:40 +0000
@@ -20,6 +20,18 @@
 
 #include <unistd.h>
 
+#if HAVE_READLINKAT
+
+# undef readlinkat
+
+ssize_t
+rpl_readlinkat (int fd, char const *file, char *buf, size_t len)
+{
+  return readlinkat (fd, file, buf, len);
+}
+
+#else
+
 /* Gnulib provides a readlink stub for mingw; use it for distinction
    between EINVAL and ENOENT, rather than always failing with ENOSYS.  */
 
@@ -34,14 +46,16 @@
    then readlink/restore_cwd.  If either the save_cwd or the restore_cwd
    fails, then give a diagnostic and exit nonzero.  */
 
-#define AT_FUNC_NAME readlinkat
-#define AT_FUNC_F1 readlink
-#define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t len
-#define AT_FUNC_POST_FILE_ARGS        , buf, len
-#define AT_FUNC_RESULT ssize_t
-#include "at-func.c"
-#undef AT_FUNC_NAME
-#undef AT_FUNC_F1
-#undef AT_FUNC_POST_FILE_PARAM_DECLS
-#undef AT_FUNC_POST_FILE_ARGS
-#undef AT_FUNC_RESULT
+# define AT_FUNC_NAME readlinkat
+# define AT_FUNC_F1 readlink
+# define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t len
+# define AT_FUNC_POST_FILE_ARGS        , buf, len
+# define AT_FUNC_RESULT ssize_t
+# include "at-func.c"
+# undef AT_FUNC_NAME
+# undef AT_FUNC_F1
+# undef AT_FUNC_POST_FILE_PARAM_DECLS
+# undef AT_FUNC_POST_FILE_ARGS
+# undef AT_FUNC_RESULT
+
+#endif

=== modified file 'lib/unistd.in.h'
--- a/lib/unistd.in.h   2014-02-25 19:21:05 +0000
+++ b/lib/unistd.in.h   2014-10-19 06:33:40 +0000
@@ -1287,13 +1287,24 @@
 
 
 #if @GNULIB_READLINKAT@
-# if address@hidden@
+# if @REPLACE_READLINKAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define readlinkat rpl_readlinkat
+#  endif
+_GL_FUNCDECL_RPL (readlinkat, ssize_t,
+                  (int fd, char const *file, char *buf, size_t len)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (readlinkat, ssize_t,
+                  (int fd, char const *file, char *buf, size_t len));
+# else
+#  if address@hidden@
 _GL_FUNCDECL_SYS (readlinkat, ssize_t,
                   (int fd, char const *file, char *buf, size_t len)
                   _GL_ARG_NONNULL ((2, 3)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (readlinkat, ssize_t,
                   (int fd, char const *file, char *buf, size_t len));
+# endif
 _GL_CXXALIASWARN (readlinkat);
 #elif defined GNULIB_POSIXCHECK
 # undef readlinkat
@@ -1407,13 +1418,25 @@
 
 
 #if @GNULIB_SYMLINKAT@
-# if address@hidden@
+# if @REPLACE_SYMLINKAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef symlinkat
+#   define symlinkat rpl_symlinkat
+#  endif
+_GL_FUNCDECL_RPL (symlinkat, int,
+                  (char const *contents, int fd, char const *file)
+                  _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (symlinkat, int,
+                  (char const *contents, int fd, char const *file));
+# else
+#  if address@hidden@
 _GL_FUNCDECL_SYS (symlinkat, int,
                   (char const *contents, int fd, char const *file)
                   _GL_ARG_NONNULL ((1, 3)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (symlinkat, int,
                   (char const *contents, int fd, char const *file));
+# endif
 _GL_CXXALIASWARN (symlinkat);
 #elif defined GNULIB_POSIXCHECK
 # undef symlinkat

=== modified file 'm4/gnulib-comp.m4'
--- a/m4/gnulib-comp.m4 2014-08-30 22:59:39 +0000
+++ b/m4/gnulib-comp.m4 2014-10-19 06:33:40 +0000
@@ -322,7 +322,7 @@
   fi
   gl_UNISTD_MODULE_INDICATOR([readlink])
   gl_FUNC_READLINKAT
-  if test $HAVE_READLINKAT = 0; then
+  if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then
     AC_LIBOBJ([readlinkat])
   fi
   gl_UNISTD_MODULE_INDICATOR([readlinkat])

=== modified file 'm4/readlinkat.m4'
--- a/m4/readlinkat.m4  2014-01-01 07:43:34 +0000
+++ b/m4/readlinkat.m4  2014-10-19 06:33:40 +0000
@@ -1,4 +1,4 @@
-# serial 3
+# serial 4
 # See if we need to provide readlinkat replacement.
 
 dnl Copyright (C) 2009-2014 Free Software Foundation, Inc.
@@ -15,5 +15,18 @@
   AC_CHECK_FUNCS_ONCE([readlinkat])
   if test $ac_cv_func_readlinkat = no; then
     HAVE_READLINKAT=0
+  else
+    AC_CACHE_CHECK([whether readlinkat signature is correct],
+      [gl_cv_decl_readlinkat_works],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+           [[#include <unistd.h>
+             /* Check whether original declaration has correct type.  */
+             ssize_t readlinkat (int, char const *, char *, size_t);]])],
+         [gl_cv_decl_readlinkat_works=yes],
+         [gl_cv_decl_readlinkat_works=no])])
+    if test "$gl_cv_decl_readlink_works" != yes; then
+      REPLACE_READLINKAT=1
+    fi
   fi
 ])

=== modified file 'm4/unistd_h.m4'
--- a/m4/unistd_h.m4    2014-01-01 07:43:34 +0000
+++ b/m4/unistd_h.m4    2014-10-19 06:33:40 +0000
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 67
+# unistd_h.m4 serial 68
 dnl Copyright (C) 2006-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -173,9 +173,11 @@
   REPLACE_PWRITE=0;       AC_SUBST([REPLACE_PWRITE])
   REPLACE_READ=0;         AC_SUBST([REPLACE_READ])
   REPLACE_READLINK=0;     AC_SUBST([REPLACE_READLINK])
+  REPLACE_READLINKAT=0;   AC_SUBST([REPLACE_READLINKAT])
   REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
   REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
   REPLACE_SYMLINK=0;      AC_SUBST([REPLACE_SYMLINK])
+  REPLACE_SYMLINKAT=0;    AC_SUBST([REPLACE_SYMLINKAT])
   REPLACE_TTYNAME_R=0;    AC_SUBST([REPLACE_TTYNAME_R])
   REPLACE_UNLINK=0;       AC_SUBST([REPLACE_UNLINK])
   REPLACE_UNLINKAT=0;     AC_SUBST([REPLACE_UNLINKAT])


reply via email to

[Prev in Thread] Current Thread [Next in Thread]