1. 07 Feb, 2011 3 commits
    • Jim Meyering's avatar
      di-set, ino-map: new modules, from coreutils · 6f0680eb
      Jim Meyering authored
      * lib/di-set.c: New file.
      * lib/di-set.h: Likewise.
      * lib/ino-map.c: Likewise.
      * lib/ino-map.h: Likewise.
      * modules/di-set: Likewise.
      * modules/di-set-tests: Likewise.
      * modules/ino-map: Likewise.
      * modules/ino-map-tests: Likewise.
      * tests/test-di-set.c: Likewise.
      * tests/test-ino-map.c: Likewise.
      6f0680eb
    • Paul Eggert's avatar
      getloadavg: merge minor changes from Emacs · 5bddd631
      Paul Eggert authored
      * lib/getloadavg.c (getloadavg_initialized): More-accurate comment.
      (getloadavg): Use memset, not bzero.
      
      2008-07-25  Chong Yidong  <cyd@stupidchicken.com>
      * lib/getloadavg.c (nl): Rename to name_list to avoid ncurses.h
      clash (bug#86).
      5bddd631
    • Bruno Haible's avatar
      Allow multiple gnulib generated replacements to coexist. · 438ac9a2
      Bruno Haible authored
      * lib/getopt.in.h (struct option): Avoid identical redefinition.
      * lib/inttypes.in.h (imaxdiv_t): Likewise.
      * lib/langinfo.in.h (nl_item): Likewise.
      * lib/math.in.h (_NaN, NAN): Likewise.
      * lib/netdb.in.h (struct addrinfo): Likewise.
      * lib/poll.in.h (struct pollfd, nfds_t): Likewise.
      * lib/pthread.in.h (pthread_t, pthread_attr_t, pthread_barrier_t,
      pthread_barrierattr_t, pthread_cond_t, pthread_condattr_t,
      pthread_key_t, pthread_mutex_t, pthread_mutexattr_t, pthread_once_t,
      pthread_rwlock_t, pthread_rwlockattr_t, pthread_cond_destroy,
      pthread_cond_init, pthread_cond_signal, pthread_cond_wait,
      pthread_create, pthread_exit, pthread_join, pthread_mutexattr_destroy,
      pthread_mutexattr_init, pthread_mutexattr_settype,
      pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock,
      pthread_mutex_trylock, pthread_mutex_unlock, pthread_spinlock_t,
      pthread_spin_init, pthread_spin_destroy, pthread_spin_lock,
      pthread_spin_trylock, pthread_spin_unlock): Likewise.
      * lib/sched.in.h (struct sched_param): Likewise.
      * lib/se-selinux.in.h (security_class_t, security_context_t,
      is_selinux_enabled, getcon, freecon, getfscreatecon, setfscreatecon,
      matchpathcon, getfilecon, lgetfilecon, fgetfilecon, setfilecon,
      lsetfilecon, fsetfilecon, security_check_context,
      security_check_context_raw, setexeccon, matchpathcon_init_prefix):
      Likewise.
      * lib/search.in.h (VISIT, _gl_search_compar_fn, _gl_search_action_fn):
      Likewise.
      * lib/signal.in.h (sig_atomic_t, sigset_t, verify_NSIG_constraint,
      _gl_function_taking_int_returning_void_t, union sigval,
      struct siginfo_t, siginfo_t, struct sigaction): Likewise.
      * lib/spawn.in.h (posix_spawnattr_t, posix_spawn_file_actions_t,
      verify_POSIX_SPAWN_USEVFORK_no_overlap): Likewise.
      * lib/stdint.in.h (gl_int8_t, gl_uint8_t, gl_int16_t, gl_uint16_t,
      gl_int32_t, gl_uint32_t, gl_int64_t, gl_uint64_t, int_least8_t,
      uint_least8_t, int_least16_t, uint_least16_t, int_least32_t,
      uint_least32_t, int_least64_t, uint_least64_t, gl_int_fast8_t,
      gl_uint_fast8_t, gl_int_fast16_t, gl_uint_fast16_t, gl_int_fast32_t,
      gl_uint_fast32_t, int_fast64_t, uint_fast64_t, gl_intptr_t,
      gl_uintptr_t, intmax_t, uintmax_t, _verify_intmax_size): Likewise.
      * lib/stdio.in.h (rpl_fseek, rpl_ftell): Likewise.
      * lib/sys_socket.in.h (sa_family_t, struct sockaddr_storage,
      socklen_t, rpl_fd_isset): Likewise.
      * lib/sys_stat.in.h (rpl_mkdir): Likewise.
      * lib/sys_time.in.h (struct timeval): Likewise.
      * lib/sys_times.in.h (struct tms): Likewise.
      * lib/sys_utsname.in.h (struct utsname):
      * lib/time.in.h (struct timespec, __time_t_must_be_integral): Likewise.
      * lib/unistd.in.h (getpagesize): Likewise.
      * lib/wchar.in.h (mbstate_t): Likewise.
      * lib/wctype.in.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit,
      iswgraph, iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit,
      towlower, towupper): Likewise.
      Reported by Sam Steingold <sds@gnu.org>.
      438ac9a2
  2. 06 Feb, 2011 1 commit
  3. 05 Feb, 2011 12 commits
    • Eric Blake's avatar
      unsetenv: work around Haiku issues · ad98f8ef
      Eric Blake authored
      On Haiku alpha 2, test-unsetenv.c passed in isolation with just
      system headers, but failed when libgnu and replacement headers
      were in use.  Why?  Because putenv("a") fails to remove "a=..."
      from the environment, but the gnulib rpl_putenv works by
      assigning to environ.  Apparently, Haiku is doing some funky
      caching issues, and correctly removes all vestiges of environment
      duplicates when Haiku is in charge, but not after assigning to
      environ forces Haiku to rebuild its cache.
      
      The m4 change is sufficient to detect Haiku's oddities, and the
      existing replacement then passes just fine.
      
      * m4/setenv.m4 (gl_FUNC_UNSETENV): Also detect Haiku issue.
      * doc/posix-functions/unsetenv.texi (unsetenv): Document it.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      ad98f8ef
    • Bruce Korb's avatar
      libposix: Add _HEADERS primaries to posix modules. · abac9b73
      Bruce Korb authored
      Modify gnulib-tool to strip them from generated Makefile.am-s where
      they are not needed.  Also, replace M4 macro prefixes when requested.
      Finally, omit calls to error() for libposix.
      abac9b73
    • Eric Blake's avatar
      strerror_r-posix: port to cygwin · cda784e7
      Eric Blake authored
      * lib/strerror_r.c (strerror_r) [__CYGWIN__]: Add cygwin
      implementation.
      * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Adjust comment.
      * tests/test-strerror_r.c (main): Fix test.
      * doc/posix-functions/strerror_r.texi (strerror_r): Document the
      issue.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      cda784e7
    • Bruno Haible's avatar
      New module 'wmemchr', part 3. · 248223b2
      Bruno Haible authored
      248223b2
    • Bruno Haible's avatar
      New module 'wmemchr', part 2. · 203637cd
      Bruno Haible authored
      203637cd
    • Bruno Haible's avatar
      New module 'wmemchr'. · b9a6d36d
      Bruno Haible authored
      * modules/wmemchr: New file.
      * lib/wchar.in.h (wmemchr): New declaration.
      * lib/wmemchr.c: New file.
      * lib/wmemchr-impl.h: New file, from libutf8 with modifications.
      * m4/wmemchr.m4: New file.
      * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMCHR,
      HAVE_WMEMCHR.
      * modules/wchar (Makefile.am): Substitute GNULIB_WMEMCHR, HAVE_WMEMCHR.
      * tests/test-wchar-c++.cc: Test the declaration of wmemchr.
      * doc/posix-functions/wmemchr.texi: Mention the new module.
      b9a6d36d
    • Eric Blake's avatar
      fdopendir: detect FreeBSD bug · e7455b30
      Eric Blake authored
      FreeBSD fdopendir(fd) always consumes fd, even if it fails with
      ENOTDIR.  The code that works around the GNU Hurd bug also fixes this;
      we just need to detect it.
      
      * m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): Detect bug.
      * doc/posix-functions/fdopendir.texi (fdopendir): Document it.
      Reported by Jim Meyering.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      e7455b30
    • Paul Eggert's avatar
      stdbool: do not define HAVE_STDBOOL_H · b17cb243
      Paul Eggert authored
      * m4/stdbool.m4 (AC_CHECK_HEADER_STDBOOL): Renamed from
      AC_HEADER_STDBOOL.  All uses changed.  Do not define
      HAVE_STDBOOL_H, as gnulib does not need this.  This change is
      imported from the latest Autoconf git.  It was motivated by Emacs,
      which uses gnulib but does not need HAVE_STDBOOL_H.
      b17cb243
    • Bruno Haible's avatar
      wcsnrtombs: Prepare for new module wwcsnrtombs. · 3c0538a1
      Bruno Haible authored
      * lib/wcsnrtombs-impl.h: New file, extracted from lib/wcsnrtombs.c.
      * lib/wcsnrtombs.c: Include it.
      * modules/wcsnrtombs (Files): Add lib/wcsnrtombs-impl.h.
      3c0538a1
    • Bruno Haible's avatar
      wcsrtombs: Prepare for new module wwcsrtombs. · 8bda5a9b
      Bruno Haible authored
      * lib/wcsrtombs-impl.h: New file, extracted from lib/wcsrtombs.c.
      * lib/wcsrtombs.c: Include it.
      * modules/wcsrtombs (Files): Add lib/wcsrtombs-impl.h.
      8bda5a9b
    • Bruno Haible's avatar
      mbsnrtowcs: Prepare for new module mbsnrtowwcs. · d45a50ed
      Bruno Haible authored
      * lib/mbsnrtowcs-impl.h: New file, extracted from lib/mbsnrtowcs.c.
      * lib/mbsnrtowcs.c: Include it.
      * modules/mbsnrtowcs (Files): Add lib/mbsnrtowcs-impl.h.
      d45a50ed
    • Bruno Haible's avatar
      mbsrtowcs: Prepare for new module mbsrtowwcs. · d980ee6c
      Bruno Haible authored
      * lib/mbsrtowcs-impl.h: New file, extracted from lib/mbsrtowcs.c.
      * lib/mbsrtowcs.c: Include it.
      * modules/mbsrtowcs (Files): Add lib/mbsrtowcs-impl.h.
      d980ee6c
  4. 04 Feb, 2011 2 commits
    • Bruno Haible's avatar
      vasnprintf: Reduce use of malloc for small format strings. · 8c6ae0f8
      Bruno Haible authored
      * lib/printf-args.h (N_DIRECT_ALLOC_ARGUMENTS): New macro.
      (arguments): Add room for the first 7 arguments.
      * lib/printf-parse.h (N_DIRECT_ALLOC_DIRECTIVES): New macro.
      (char_directives, u8_directives, u16_directives, u32_directives): Add
      room for the first 7 directives.
      * lib/printf-parse.c: Include <string.h>.
      (PRINTF_PARSE): Change memory handling code so that it uses the first
      7 preallocated elements in an 'arguments' or 'DIRECTIVES' struct.
      * lib/vasnprintf.c (VASNPRINTF): Update memory handling code.
      Reported by Pádraig Brady <P@draigbrady.com>.
      8c6ae0f8
    • Karl Berry's avatar
      autoudpate · b6b8999a
      Karl Berry authored
      b6b8999a
  5. 01 Feb, 2011 2 commits
    • Karl Berry's avatar
      update from texinfo · a036b768
      Karl Berry authored
      a036b768
    • Eric Blake's avatar
      dup2: work around Haiku bug · 0e9ef9b9
      Eric Blake authored
      dup2(n,n) must be a no-op, but on Haiku, it resets FD_CLOEXEC.
      However, we must keep the Linux workaround for dup2(n,n)
      returning (unsigned int)-EBADF.
      
      * m4/dup2.m4 (gl_FUNC_DUP2): Test for bug.
      * lib/dup2.c (rpl_dup2) [!WIN32]: Add workaround.
      * doc/posix-functions/dup2.texi (dup2): Document the bug.
      * tests/test-dup2.c (main): Enhance test.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      0e9ef9b9
  6. 31 Jan, 2011 2 commits
  7. 30 Jan, 2011 5 commits
  8. 29 Jan, 2011 5 commits
    • Paul Eggert's avatar
      mktime: fix some integer overflow issues and sidestep the rest · 385b9f9d
      Paul Eggert authored
      This was prompted by a bug report by Benjamin Lindner for MinGW
      <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00472.html>.
      His bug is due to signed integer overflow (0 - INT_MIN), and I
      I scanned through mktime.c looking for other integer overflow
      problems, fixing all the bugs I found.
      
      Although the C Standard says the resulting code is still not safe
      in the presence of integer overflow, in practice it should be good
      enough for all real-world two's-complement implementations, except
      for debugging environments that deliberately trap on integer
      overflow (e.g., gcc -ftrapv).
      
      * lib/mktime.c (WRAPV): New macro.
      (SHR): Also check that long_int and time_t shift right in the
      usual way, before using the fast-but-unportable method.
      (TYPE_ONES_COMPLEMENT, TYPE_SIGNED_MAGNITUDE): Remove, no longer
      used.  The code already assumed two's complement, so there's
      no need to test for alternatives.  All uses removed.
      (TYPE_MAXIMUM): Don't rely here on overflow behavior not defined by
      the C standard.  Problem reported by Rich Felker in
      <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00488.html>.
      (twos_complement_arithmetic): Also check long_int and time_t.
      (time_t_avg, time_t_add_ok, time_t_int_add_ok): New functions.
      (guess_time_tm, ranged_convert, __mktime_internal): Use them.
      (__mktime_internal): Avoid integer overflow with unary subtraction
      in two instances where -1 - X is an adequate replacement for -X,
      since the calculations are approximate.
      385b9f9d
    • Eric Blake's avatar
      mktime: avoid infinite loop · 3682048d
      Eric Blake authored
      * m4/mktime.m4 (AC_FUNC_MKTIME): Avoid overflow on possibly-signed
      type; behavior is still undefined but portable to all known targets.
      Reported by Rich Felker.
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      3682048d
    • Simon Josefsson's avatar
      rename, unlink, same-inode: Relicense. · 1571c2cd
      Simon Josefsson authored
      * modules/rename (License): Relax from LGPLv3+ to LGPLv2+.
      * modules/unlink (License): Likewise.
      * modules/same-inode (License): Likewise.
      1571c2cd
    • Paul Eggert's avatar
      mktime: avoid problems on NetBSD 5 / i386 · b34d6825
      Paul Eggert authored
      * lib/mktime.c (long_int): New type.  This works around a problem
      on NetBSD 5 / i386, where 'long int' and 'int' are both 32 bits
      but time_t is 64 bits, and where I expect the existing code is
      wrong in some cases.
      (leapyear, ydhms_diff, guess_time_tm, __mktime_internal): Use it.
      (ydhms_diff): Bring back the compile-time check for wide-enough
      year and yday.
      b34d6825
    • Karl Berry's avatar
      autoupdate · 1424298f
      Karl Berry authored
      1424298f
  9. 28 Jan, 2011 4 commits
  10. 27 Jan, 2011 3 commits
    • Bruno Haible's avatar
      Prepare for supporting FreeBSD 10. · 1bf9d10c
      Bruno Haible authored
      * build-aux/config.libpath: Remove handling of freebsd1*.
      1bf9d10c
    • Gerald Pfeifer's avatar
      Prepare for supporting FreeBSD 10. · 4fc71678
      Gerald Pfeifer authored
      * build-aux/config.rpath: Remove handling of freebsd1* which soon would
      match FreeBSD 10.0.
      4fc71678
    • Bruno Haible's avatar
      vma-iter, get-rusage-as: Add OpenBSD support. · c428797e
      Bruno Haible authored
      * modules/vma-iter (configure.ac): Test for mquery.
      * lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Define also on OpenBSD.
      * lib/vma-iter.c: Include <sys/mman.h>.
      (vma_iterate): Add an implementation based on mquery().
      * lib/resource-ext.h (get_rusage_as): Update comments.
      * lib/get-rusage-as.c: Likewise.
      * lib/get-rusage-data.c: Likewise.
      c428797e
  11. 26 Jan, 2011 1 commit