1. 07 Oct, 2013 4 commits
    • Paul Eggert's avatar
      New module 'count-trailing-zeros'. · 0a47086e
      Paul Eggert authored
      * MODULES.html.sh: Mention it.
      * lib/count-trailing-zeros.c, lib/count-trailing-zeros.h:
      * m4/count-trailing-zeros.m4, modules/count-trailing-zeros:
      * modules/count-trailing-zeros-tests:
      * tests/test-count-trailing-zeros.c:
      New files.
    • Paul Eggert's avatar
      count-leading-zeros: port to MSC; support types wider than 64 bits · 4ec4a8e6
      Paul Eggert authored
      The ideas behind the MSC port are stolen from Emacs.
      * lib/count-leading-zeros.h:
      Don't include verify.h: it's no longer needed, as types wider than
      64 bits are now supported.
      (COUNT_LEADING_ZEROS): New arg MSC_BUILTIN, for better
      performance with MSC.  All uses changed.  Do not assume that TYPE
      has at most 64 bits.
      (count_leading_zeros_32): Assume 0 < X < 2**32, for speed.
      All uses changed.  Fold the subtraction from 31 into the table.
    • Paul Eggert's avatar
      count-one-bits: port to MSC; support types wider than 64 bits · 75588b6e
      Paul Eggert authored
      The ideas behind the MSC port are stolen from Emacs.
      * lib/count-one-bits.c (popcount_support) [_MSC_VER]: New variable.
      * lib/count-one-bits.h: Include limits.h, for CHAR_BIT.
      Don't include verify.h: it's no longer needed, as types wider than
      64 bits are now supported.
      (COUNT_ONE_BITS_GENERIC): New macro.
      (popcount_supported) [_MSC_VER]: New inline function.
      (COUNT_ONE_BITS): Use it.  New arg MSC_BUILTIN, for better
      performance with MSC.  All uses changed.  Do not assume that TYPE
      has at most 64 bits.
      * modules/count-one-bits (Depends-on): Do not depend on 'verify'.
    • Andrew Borodin's avatar
      mountlist: fix resource leak with MOUNTED_INTERIX_STATVFS · 98171ec2
      Andrew Borodin authored
      * lib/mountlist.c (read_file_system_list): fix leak of directory
      streams in case of #ifdef MOUNTED_INTERIX_STATVFS.
      Signed-off-by: default avatarAndrew Borodin <aborodin@vmail.ru>
  2. 06 Oct, 2013 1 commit
  3. 03 Oct, 2013 1 commit
    • Paul Eggert's avatar
      verify: new macro 'assume' · 28df8b1e
      Paul Eggert authored
      This is taken from Emacs, and should be generally useful.
      * doc/verify.texi (assume): Document it.
      * lib/verify.h (assume): New macro.
      (__has_builtin): Expand to 0 if not defined.
  4. 01 Oct, 2013 1 commit
  5. 26 Sep, 2013 2 commits
    • Eric Blake's avatar
      dup2, dup3: work around another cygwin crasher · fdd1b511
      Eric Blake authored
      Cygwin 1.7.25 can crash due to an off-by-one bug on an attempt to
      duplicate a file into the current RLIMIT_NOFILE soft limit, when
      that limit is smaller than the hard limit.  The intent in the
      cygwin code was to allow the dup and auto-increase the soft limit,
      which is itself questionable (and which we work around in the
      gnulib getdtablesize module); but avoiding the crash is worth
      doing even if the soft limit semantics are wrong.
      * m4/dup2.m4 (gl_FUNC_DUP2): Expose the bug.
      * m4/dup3.m4 (gl_FUNC_DUP3): Likewise.
      * tests/test-dup2.c (main): Likewise.
      * lib/dup2.c (rpl_dup2): Use setdtablesize to avoid it.
      * lib/dup3.c (dup3): Likewise.
      * doc/posix-functions/dup2.texi (dup2): Document it.
      * doc/glibc-functions/dup3.texi (dup3): Likewise.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    • Eric Blake's avatar
      getdtablesize: work around cygwin issue · 3bd0d48d
      Eric Blake authored
      Cygwin 1.7.25 has a bug that even though it claims to support
      RLIMIT_NOFILE inheritance, there is no enforcement of the soft
      limit, and getdtablesize() automatically grows until it reaches
      the hard limit which cannot be changed by setrlimit().  Best is
      to just treat things as an invariant limit, as several other
      modules assume that getdtablesize() will not change without an
      intervening setrlimit().
      * m4/getdtablesize.m4 (gl_FUNC_GETDTABLESIZE): Detect problem.
      * modules/getdtablesize (configure.ac): Build replacement.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set up a witness.
      * modules/unistd (Makefile.am): Expose the witness.
      * lib/unistd.in.h (getdtablesize): Declare replacement.
      * lib/getdtablesize.c (rpl_getdtablesize): Work around it.
      * tests/test-getdtablesize.c (main): Test it.
      * doc/glibc-functions/getdtablesize.texi (getdtablesize): Document it.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
  6. 25 Sep, 2013 1 commit
  7. 24 Sep, 2013 1 commit
    • Eric Blake's avatar
      manywarnings: enable nicer gcc warning messages · 4a5ee89c
      Eric Blake authored
      With gcc 4.3.4, -Wdisabled-optimization is noisy unless you also
      use -funit-at-a-time.
      With gcc 4.4.7, there is no indication which warning option
      triggered a particular message unless you also use
      Both of these options are default in newer gcc (such as 4.8.1);
      but including them in the list of possible warnings makes the
      experience nicer on older platforms.
      * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Older gcc requires
      some -f options for optimal warnings.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
  8. 23 Sep, 2013 4 commits
    • Jim Meyering's avatar
      timespec: use the new TIMESPEC_RESOLUTION in a few more places · aa20227c
      Jim Meyering authored
      * lib/timespec-add.c (timespec_add): Also replace 999999999
      * lib/timespec-sub.c (timespec_sub): Likewise.
    • Paul Eggert's avatar
      warnings: port --enable-gcc-warnings to Solaris Studio 12.3 · cf70364d
      Paul Eggert authored
      Problem reported by Dagobert Michelsen via Eric Blake in
      * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Use AC_LINK_IFELSE,
    • Eric Blake's avatar
      configmake: support new --runstatedir option · ecac7ac5
      Eric Blake authored
      http://lwn.net/Articles/436012/ documents that many distros
      are now preferring to use /run rather than /var/run for
      storage of pid files and other per-process temporary files
      that must not be cleaned out during arbitrary TMPDIR sweeps.
      As such, the GNU Coding Standards were recently changed to
      recommend a new configure option to make it easy to choose
      this directory at configure time, and autoconf 2.70 will
      support the new directory by default.  This patch adds support
      for propagating results of the new option (for new enough
      autotools) or providing a sane default (for older autotools)
      into C code.
      * m4/configmake.m4 (gl_CONFIGMAKE_PREP): Substitute runstatedir
      even if autoconf was too old to provide the command line option.
      * modules/configmake (Makefile.am): Propagate it to .h file.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    • Paul Eggert's avatar
      ctype, string: depend on extern-inline · b8c71610
      Paul Eggert authored
      This is needed to complete the recent OS X fixes.
      Also, fix related documentation as suggested by Eric Blake.
      * doc/posix-functions/isalnum.texi, doc/posix-functions/isalpha.texi:
      * doc/posix-functions/isascii.texi, doc/posix-functions/iscntrl.texi:
      * doc/posix-functions/isdigit.texi, doc/posix-functions/isgraph.texi:
      * doc/posix-functions/islower.texi, doc/posix-functions/isprint.texi:
      * doc/posix-functions/ispunct.texi, doc/posix-functions/isspace.texi:
      * doc/posix-functions/isupper.texi, doc/posix-functions/isxdigit.texi:
      * doc/posix-functions/toascii.texi, doc/posix-functions/tolower.texi:
      * doc/posix-functions/toupper.texi:
      List the 'ctype' gnulib module.
      * doc/posix-functions/strcat.texi, doc/posix-functions/strcpy.texi:
      * doc/posix-functions/strncpy.texi:
      List the 'string' gnulib module.
      * modules/memcpy, modules/memmove, modules/memset (Depends-on):
      Add string.
      * modules/ctype, modules/string (Depends-on): Add extern-inline.
  9. 21 Sep, 2013 1 commit
    • Pádraig Brady's avatar
      userspec: support optional parameters to parse_user_spec() · 798e9bc8
      Pádraig Brady authored
      * lib/userspec.c (parse_user_spec): If the GID param is NULL,
      then avoid group processing and treat the full spec as a user.
      (parse_with_separator): Allow the USERNAME and GROUPNAME to
      be optional params (NULL), in which case they're ignored.
      * tests/test-userspec.c (main): Ensure NULL params are ignored.
  10. 19 Sep, 2013 7 commits
    • Paul Eggert's avatar
      timespec: new function make_timespec, and new constants · cf0e1bcd
      Paul Eggert authored
      * lib/timespec.h: Incorporate recent changes on the Emacs trunk.
      (make_timespec): New function.
      * lib/dtotimespec.c (dtotimespec):
      * lib/timespec-add.c (timespec_add):
      * lib/timespec-sub.c (timespec_sub):
      * lib/utimens.c (validate_timespec):
      * lib/utimensat.c (rpl_utimensat):
      Use these new constants and functions.
    • Paul Eggert's avatar
      stdio: OS X port of putc_unlocked + extern inline · 6f3c76e0
      Paul Eggert authored
      * lib/stdio.in.h (putc_unlocked): #undef on problematic Apple platforms.
      * doc/posix-functions/putc_unlocked.texi:
      * doc/posix-functions/putchar_unlocked.texi:
      Document this portability problem.
    • Paul Eggert's avatar
      signal: OS X port of sigaddset etc. + extern inline · 1184458d
      Paul Eggert authored
      * lib/signal.in.h (sigaddset, sigdelset, sigemptyset, sigfillset)
      (sigismember): #undef on problematic Apple platforms.
      * doc/posix-functions/sigaddset.texi:
      * doc/posix-functions/sigdelset.texi:
      * doc/posix-functions/sigemptyset.texi:
      * doc/posix-functions/sigfillset.texi:
      * doc/posix-functions/sigismember.texi:
      Document this portability problem.
    • Paul Eggert's avatar
      extern-inline: do not always suppress extern inline on OS X · ddd30c54
      Paul Eggert authored
      * m4/extern-inline.m4 (gl_EXTERN_INLINE): Suppress the use of
      extern inline on Apple only if the particular compile-time
      configuration is known to have the problem.
      (_GL_EXTERN_INLINE_APPLE_BUG): New private macro, to implement this.
      (_GL_EXTERN_LNLINE_IN_USE): New macro, intended for use by
      other Gnulib modules.
    • Paul Eggert's avatar
      extern-inline: document fixes for ctype and wctype macros · 7425595f
      Paul Eggert authored
      * doc/posix-functions/isalnum.texi, doc/posix-functions/isalpha.texi:
      * doc/posix-functions/isascii.texi, doc/posix-functions/isblank.texi:
      * doc/posix-functions/iscntrl.texi, doc/posix-functions/isdigit.texi:
      * doc/posix-functions/isgraph.texi, doc/posix-functions/islower.texi:
      * doc/posix-functions/isprint.texi, doc/posix-functions/ispunct.texi:
      * doc/posix-functions/isspace.texi, doc/posix-functions/isupper.texi:
      * doc/posix-functions/iswalnum.texi, doc/posix-functions/iswalpha.texi:
      * doc/posix-functions/iswcntrl.texi, doc/posix-functions/iswctype.texi:
      * doc/posix-functions/iswdigit.texi, doc/posix-functions/iswgraph.texi:
      * doc/posix-functions/iswlower.texi, doc/posix-functions/iswprint.texi:
      * doc/posix-functions/iswpunct.texi, doc/posix-functions/iswspace.texi:
      * doc/posix-functions/iswupper.texi, doc/posix-functions/iswxdigit.texi:
      * doc/posix-functions/isxdigit.texi, doc/posix-functions/toascii.texi:
      * doc/posix-functions/memcpy.texi, doc/posix-functions/memmove.texi:
      * doc/posix-functions/memset.texi, doc/posix-functions/stpcpy.texi:
      * doc/posix-functions/stpncpy.texi, doc/posix-functions/strcat.texi:
      * doc/posix-functions/strcpy.texi, doc/posix-functions/strncat.texi:
      * doc/posix-functions/strncpy.texi:
      * doc/posix-functions/tolower.texi, doc/posix-functions/toupper.texi:
      * doc/posix-functions/towlower.texi, doc/posix-functions/towupper.texi:
      Document that Gnulib fixes portability problems with these
      functions on OS X 10.8 and earlier when called from plain inline
      or extern inline functions.
    • Kevin Cernekee's avatar
      fflush, freadahead, fseeko: Fix for Android · 2448628a
      Kevin Cernekee authored
      * lib/stdio-impl.h: Use local __sfileext definition.
      Suggested by Bruno Haible in:
      fflush, freadahead, and fseeko have trouble compiling on Android[1]
      because they need access to internal elements of the FILE struct.
      Bionic libc[2], like OpenBSD libc[3], puts the ungetc buffer "_ub"
      at the beginning of the __sfileext struct.  Therefore we can reuse the
      existing OpenBSD implementation for Android.
      Test results (Android 4.2.2, ARMv7, NDK r9):
          root@android:/data/local/tmp # export srcdir=`pwd`
          root@android:/data/local/tmp # ./test-fflush2.sh ; echo $?
          root@android:/data/local/tmp # ./test-freadahead.sh ; echo $?
          root@android:/data/local/tmp # ./test-fseeko.sh ; echo $?
          root@android:/data/local/tmp # ./test-fseeko2.sh ; echo $?
          Skipping test: ungetc cannot handle arbitrary bytes
          root@android:/data/local/tmp # ./test-fseeko3.sh ; echo $?
          root@android:/data/local/tmp # ./test-fseeko4.sh ; echo $?
      [1] http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00295.html
      [2] https://android.googlesource.com/platform/bionic/+/android-4.3_r2.2/libc/stdio/fileext.h
      [3] http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=1.2;content-type=text%2Fplain
    • Mats Erik Andersson's avatar
      pmccabe2html: fix portability issues · bacee67d
      Mats Erik Andersson authored
      Allow awk versions other than Gawk.
      Correct wrong HTML tag closures.
  11. 18 Sep, 2013 1 commit
  12. 13 Sep, 2013 2 commits
  13. 11 Sep, 2013 1 commit
  14. 09 Sep, 2013 1 commit
  15. 07 Sep, 2013 1 commit
    • Eric Blake's avatar
      glob: fix build for platforms without __THROW · 465099e8
      Eric Blake authored
      The previous fix for glibc broke builds on non-glibc platforms
      that don't pre-define __THROW.  Perhaps we could make the code
      more optimal by using gcc attributes instead of expanding to
      nothing, to match the glibc usage; but for now this fixes the
      build.  Reproted by Tom G. Christensen.
      * lib/glob.in.h (__THROW): Add definition again.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
  16. 06 Sep, 2013 1 commit
  17. 05 Sep, 2013 1 commit
  18. 04 Sep, 2013 1 commit
    • Eric Blake's avatar
      glob: avoid -Wattribute warnings on glibc · b9ad0444
      Eric Blake authored
      Colin Watson reported that some versions of gcc warn about the use
      of attribute((leaf)) on static functions, since it is documented to
      have an effect only on external functions.
      * lib/glob.c (next_brace_sub, prefix_array, collated_compare): Use
      __THROWNL, not __THROW, on static functions.
      * lib/glob.in.h (__THROW): Adjust...
      (__THROWNL): ...accordingly.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
  19. 29 Aug, 2013 1 commit
    • Paul Eggert's avatar
      headers: check that _GL_INLINE_HEADER_BEGIN is defined · ece81a73
      Paul Eggert authored
      Suggested by Bruce Korb in:
      * doc/extern-inline.texi (extern inline):
      Suggest checking that _GL_INLINE_HEADER_BEGIN is defined.
      * lib/acl-internal.h, lib/argp-fmtstream.h, lib/argp.h:
      * lib/binary-io.h, lib/bitrotate.h, lib/count-leading-zeros.h:
      * lib/count-one-bits.h, lib/eealloc.h, lib/execinfo.in.h:
      * lib/gethrxtime.h, lib/gl_list.h, lib/gl_oset.h, lib/gl_xlist.h:
      * lib/gl_xoset.h, lib/gl_xsublist.h, lib/glthread/cond.h:
      * lib/glthread/thread.h, lib/math.in.h, lib/mbchar.h, lib/mbfile.h:
      * lib/mbiter.h, lib/mbuiter.h, lib/openat.h, lib/pipe-filter-aux.h:
      * lib/priv-set.h, lib/pthread.in.h, lib/savewd.h, lib/se-context.in.h:
      * lib/se-selinux.in.h, lib/sig-handler.h, lib/stat-time.h:
      * lib/sys_socket.in.h, lib/timespec.h, lib/u64.h, lib/unistd.in.h:
      * lib/utimens.h, lib/wctype.in.h, lib/xalloc.h, lib/xsize.h:
      * lib/xtime.h:
      Check that _GL_INLINE_HEADER_BEGIN is defined.
  20. 28 Aug, 2013 1 commit
  21. 26 Aug, 2013 1 commit
    • Simon Josefsson's avatar
      gc: support HMAC-SHA256 and HMAC-SHA512. · 4e1dc0e3
      Simon Josefsson authored
      * lib/gc.h: Add gc_hmac_sha256 and gc_hmac_sha512.
      * lib/gc-libgcrypt.c (gc_hmac_sha256, gc_hmac_sha512): New
      (gc_hmac_md5): Use symbolic constant.
      * lib/gc-gnulib.c: Include hmac.h for HMAC-SHA256/512 too.
      (gc_hmac_sha256, gc_hmac_sha512): New functions.
      * lib/hmac.h: Add hmac_sha256 and hmac_sha512 prototypes.
      * m4/sha256.m4: Protect against empty expansion.
      * m4/sha512.m4: Likewise.
      * lib/hmac-sha256.c: New file.
      * lib/hmac-sha512.c: Likewise.
      * m4/gc-hmac-sha256.m4: Likewise.
      * m4/gc-hmac-sha512.m4: Likewise.
      * m4/gc-sha256.m4: Likewise.
      * m4/gc-sha512.m4: Likewise.
      * modules/crypto/gc-hmac-sha256: Likewise.
      * modules/crypto/gc-hmac-sha256-tests: Likewise.
      * modules/crypto/gc-hmac-sha512: Likewise.
      * modules/crypto/gc-hmac-sha512-tests: Likewise.
      * modules/crypto/hmac-sha256: Likewise.
      * modules/crypto/hmac-sha256-tests: Likewise.
      * modules/crypto/hmac-sha512: Likewise.
      * modules/crypto/hmac-sha512-tests: Likewise.
      * tests/test-gc-hmac-sha256.c: Likewise.
      * tests/test-gc-hmac-sha512.c: Likewise
      * tests/test-hmac-sha256.c: Likewise.
      * tests/test-hmac-sha512.c: Likewise
  22. 24 Aug, 2013 1 commit
  23. 23 Aug, 2013 1 commit
    • Paul Eggert's avatar
      selinux-at: omit unnecessary include · c9451e3b
      Paul Eggert authored
      * lib/selinux-at.c: Don't include dosname.h; not needed, since
      this source file doesn't use its macros, and subsidiary files that
      use the macros already include it.
  24. 22 Aug, 2013 1 commit
  25. 21 Aug, 2013 1 commit
    • Eric Blake's avatar
      d-ino: avoid false negative on symlink · 9a52d861
      Eric Blake authored
      If the first entry listed in a directory is a symlink, we
      had a spurious mismatch between d_ino (which should match the
      symlink) and stat() results (which chases the symlink).
      Reported by Stephane Chazelas <stephane.chazelas@gmail.com>.
      * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use lstat.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
  26. 20 Aug, 2013 1 commit