Jim Meyering [Mon, 8 Jan 2007 10:32:58 +0000 (10:32 +0000)]
Use a more robust test for a "can't happen" condition.
* lib/fts.c (fts_read): Revert the change of 2006-11-22, since it
narrowed the st_size value. Presuming the "can't happen" condition
is true, that narrowing could conceivably convert an invalid st_size
value into a valid one. Instead, use a change based on Matthew
Woehlke's original patch.
Jim Meyering [Mon, 8 Jan 2007 10:30:47 +0000 (10:30 +0000)]
Slight readability improvement: use an assert-like macro
in place of literal "abort ()" uses.
* lib/fts.c (fts_assert): Define.
(fts_set_stat_required, cwd_advance_fd, fts_read, fd_ring_check):
Use this macro instead of a bare 'abort'.
Paul Eggert [Sat, 6 Jan 2007 00:27:48 +0000 (00:27 +0000)]
Don't worry about using IRIX 5.3's wctype.h broken definitions;
simply work around them.
* lib/wctype_.h: Remove test for HAVE_WCTYPE_CTMP_BUG.
(iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph, iswlower):
(iswprint, iswpunct, iswspace, iswupper, iswxdigit): Undef before declaring.
Don't bother to define as macros, since the standard doesn't require it.
* m4/wctype.m4 (WCTYPE_H, ABSOLUTE_WCTYPE_H): Simplify, since we no
longer worry about IRIX 5.3.
(HAVE_WCTYPE_CTMP_BUG): Remove.
Paul Eggert [Thu, 4 Jan 2007 19:21:42 +0000 (19:21 +0000)]
* lib/wctype_.h (_ctmp_) [HAVE_WCTYPE_CTMP_BUG]: Now of type wchar_t,
not wint_t. Also, include <ctype.h>, to fix another IRIX bug.
* m4/wctype.m4 (gl_WCTYPE_H): Likewise.
Problems reported by Georg Schwarz for IRIX 5.3.
Paolo Bonzini [Wed, 3 Jan 2007 10:51:18 +0000 (10:51 +0000)]
2007-01-03 Paolo Bonzini <bonzini@gnu.org>
Yoann Vandoorselaere <yoann.v@prelude-ids.com>
* lib/poll.c (poll): Use recv on Mac OS X to distinguish connected
sockets, server sockets, and other file descriptors. Count errors
to compute the return value. Reorder the code a bit to be easier
to follow. Don't set event bits that were not requested (except
POLLERR and POLLHUP).
Paul Eggert [Sun, 31 Dec 2006 06:29:50 +0000 (06:29 +0000)]
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Rewrite so as not to assume GNU sort. Also, don't assume
the C locale, and avoid an "eval" that could cause trouble.
Paul Eggert [Fri, 29 Dec 2006 19:33:46 +0000 (19:33 +0000)]
* lib/acl.h: Include sys/types.h and sys/stat.h, for mode_t and
struct stat. Problem reported by Henning Nielsen Lund.
* lib/acl.c: Include acl.h first, to check interface. Don't
bother to include sys/types.h and sys/stat.h again.
Paul Eggert [Tue, 26 Dec 2006 01:51:36 +0000 (01:51 +0000)]
* gnulib-tool (SED): Remove, undoing previous change.
The problem was that it broke coreutils on Solaris, because
"sed --posix" leaked into a makefile.
(sed): New alias, if 'alias' and GNU sed.
Jim Meyering [Sun, 24 Dec 2006 17:08:04 +0000 (17:08 +0000)]
Work around an fchownat bug in glibc-2.4:
http://lists.ubuntu.com/archives/ubuntu-users/2006-September/093218.html
This bug would cause "chown -RP ... DIR" to follow symlinks in DIR,
in spite of the -P option.
* m4/openat.m4 (gl_FUNC_FCHOWNAT, gl_FUNC_FCHOWNAT_DEREF_BUG):
New macros.
(gl_PREREQ_OPENAT): Require gl_FUNC_FCHOWNAT.
* modules/openat (Files): Add lib/fchownat.c.
* lib/openat.c (fchownat): Don't define here. Move to...
* lib/fchownat.c: ...this new file.
Paul Eggert [Sun, 24 Dec 2006 07:55:08 +0000 (07:55 +0000)]
Fix bug reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2006-12/msg00228.html>
where quotearg.c didn't compile on Mac OS X 10.2 because it
lacks <wchar.h> and wint_t.
* lib/wctype_.h (__wctype_wint_t): New type.
Include <stdio.h>, <time.h>, <wchar.h> only if HAVE_WINT_T.
(iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph):
(iswlower, iswprint, iswpunct, iswspace, iswupper, ixwxdigit):
Arg is now of type __wctype_wint_t, not wint_t.
* m4/wctype.m4 (gl_WCTYPE_H): Require gt_TYPE_WINT_T, and
substitute HAVE_WINT_T.
* modules/wctype (Files): Add m4/wint_t.m4.
(wctype.h): Substitute HAVE_WINT_T.
Paul Eggert [Fri, 22 Dec 2006 08:53:57 +0000 (08:53 +0000)]
* m4/mktime.m4 (AC_FUNC_MKTIME): Sync from Autoconf.
Include <limits.h>, and use its INT_MAX to rewrite the
j loop so that it does not overflow 'int'. Problem reported by
Ralf Wildenhues in
<http://lists.gnu.org/archive/html/bug-gnulib/2006-12/msg00084.html>.
Play it safe by shifting left by 1 rather than multiplying by 2,
as GCC is less likely to optimize this away when the value
is signed (when it assumes overflow leads to undefined behavior).
Also, don't assume time_t uses two's complement.
Paul Eggert [Fri, 22 Dec 2006 00:21:54 +0000 (00:21 +0000)]
* MODULES.html.sh: New module wctype.
* lib/wctype_.h, m4/wctype.m4, modules/wctype: New files.
* lib/fnmatch.c: Don't bother to include <wchar.h> before
<wctype.h>, since the new wctype module should fix this.
* lib/quotearg.c: Include <wctype.h> unconditionally, since
the wctype module should arrange for it.
* lib/regex_internal.h: Likewise.
* m4/quotearg.m4 (gl_QUOTEARG): Don't check for wctype.h or iswprint,
since the wctype module should handle this now.
* m4/regex.m4 (gl_PREREQ_REGEX): Don't check for wctype.h.
* modules/fnmatch (Depends-on): Add wctype.
* modules/quotearg (Depends-on): Likewise.
* modules/regex (Depends-on): Likewise.
Paul Eggert [Mon, 18 Dec 2006 18:04:20 +0000 (18:04 +0000)]
* lib/dirname.h (DOUBLE_SLASH_IS_DISTINCT_ROOT): Default to 0, not 1.
This is more consistent with the other defines here.
* m4/double-slash-root.m4 (gl_DOUBLE_SLASH_ROOT):
Port to z/OS. Problem reported by Paul Gilmartin.
Change local vars to use gl_ prefix rather than ac_.
Don't define DOUBLE_SLASH_IS_DISTINCT_ROOT to 0, for consistency
with other defines.
* modules/double-slash-root: New module.
* modules/dirname (Files): Remove m4/double-slash-root.m4.
(Depends-on): Add double-slash-root.
* MODULES.html.sh (File system functions): Mention new module.
Paul Eggert [Thu, 14 Dec 2006 18:47:36 +0000 (18:47 +0000)]
* lib/yesno.c [!ENABLE_NLS]: Don't include getline.h.
(yesno) [!ENABLE_NLS]: Don't invoke getline or rpmatch.
This is for the benefit of gzip, which doesn't do i18n.
Paul Eggert [Tue, 12 Dec 2006 07:37:26 +0000 (07:37 +0000)]
* m4/openat.m4 (gl_FUNC_OPENAT): Don't compile mkdirat
and fchmodat unconditionally, since glibc 2.4 has them.
Problem reported by Arkadiusz Miskiewicz.
Jim Meyering [Fri, 8 Dec 2006 09:28:23 +0000 (09:28 +0000)]
* build-aux/announce-gen: Add two new options, both optional:
--bootstrap-tools=TOOL_LIST
a comma-separated list of tools, e.g.,
autoconf,automake,bison,gnulib
--gnulib-snapshot-date=DATE
if gnulib is in the bootstrap tool list,
then report this as the snapshot date.
If not specified, use the current date/time.
If you specify a date here, be sure it's UTC.
Paul Eggert [Tue, 5 Dec 2006 18:09:17 +0000 (18:09 +0000)]
* lib/utimens.c (futimens) [HAVE_BUGGY_NFS_TIME_STAMPS]: Add a
workaround for this case. It is not autoconfigured now; offhand
it's hard to see how to autoconfigure it.
Paul Eggert [Mon, 4 Dec 2006 07:23:36 +0000 (07:23 +0000)]
* lib/mkdir-p.c (make_dir_parents): Fix race condition when making
a directory that is about to be chowned. Such a directory's
initial file permissions should permit the owner only and this
should not be changed until after the chown, since the group and
other bits would be incorrect if they granted permission before
the chown.
Jim Meyering [Sun, 3 Dec 2006 10:23:10 +0000 (10:23 +0000)]
* lib/fts.c (fts_load): Don't set sp->fts_dev here, since
p->fts_statp may not yet be defined.
(fts_read): Instead, set it in the caller, once p->fts_statp is
sure to be defined, and corresponds to a top-level directory.
Jim Meyering [Sat, 2 Dec 2006 09:18:36 +0000 (09:18 +0000)]
* modules/savewd (Depends-on): Add fcntl_h to avoid self-test
build failure due to missing definition of HAVE_WORKING_O_NOFOLLOW.
Reported by Simon Josefsson.
Paul Eggert [Thu, 30 Nov 2006 23:11:30 +0000 (23:11 +0000)]
* m4/warning.m4: Use the all-permissive copyright notice
recommended by RMS (rather than LGPL).
* m4/vararrays.m4: Likewise.
* m4/flexmember.m4: Likewise.
Paul Eggert [Mon, 27 Nov 2006 07:15:26 +0000 (07:15 +0000)]
Fix some incompatibilities with gcc -ansi -pedantic.
* lib/regex.h (__restrict_arr): Don't use the [restrict] syntax
if compiling pedantically with GCC, unless it's C99 or later.
Don't trust sys/cdefs.h's definition of __restrict_arr, either, as
it mishandles gcc -ansi -pedantic as well.
* lib/regex_internal.h (re_token_t): Don't use enum bitfields
if gcc -pedantic.
* lib/regexec.c (check_node_accept_bytes): Don't use auto
initializers for struct if -pedantic, unless it's C99 or later.