Eric Blake [Thu, 7 Jan 2010 03:47:08 +0000 (20:47 -0700)]
maint.mk: detect incorrect GFDL usage
Similar to the existing sc_GPL_version. Fortunately, the two licenses
have enough distinction in wording so that neither regexp is a false
positive for the other license. This won't catch files that line wrap
differently than expected; as it was, the GFDL needed two regexp to
handle the use of GFDL in the m4 project.
* top/maint.mk (_GFDL_regexp, sc_GFDL_version): New rule.
Eric Blake [Wed, 6 Jan 2010 17:03:34 +0000 (10:03 -0700)]
maint.mk: ignore multi-line copyright in NEWS
The old algorithm did not work for projects like m4 that used
long-hand copyright years that wrapped lines. Meanwhile, this
change has no impact to single-line copyrights, like coreutils.
Changing the rest of the footer, such as bumping from GFDL 1.2
to GFDL 1.3, will still require the developer to rerun
'make update-NEWS-hash' to get the hash back in sync, but that
is probably less frequent.
* top/maint.mk (NEWS_hash): Add immunity to multi-line copyright.
Eric Blake [Wed, 6 Jan 2010 14:09:03 +0000 (07:09 -0700)]
stdio, unistd: guarantee ssize_t
Per POSIX 2008, ssize_t needs to exist whether or not we are
replacing functions that use it. For now, we only guarantee
it if we know that the user expects a function that uses
that type, while waiting for glibc to catch up to POSIX.
* lib/unistd.in.h (includes): Ensure that types required by POSIX
2008 are exposed when needed.
* lib/stdio.in.h (includes): Likewise.
Reported by Ralf Wildenhues.
Jim Meyering [Wed, 6 Jan 2010 07:38:14 +0000 (08:38 +0100)]
readtokens: this module *does* require xalloc.h
It uses only functions that were omitted by the old syntax-check rule.
* lib/readtokens.c: Include "xalloc.h" once again.
* modules/readtokens (Depends-on): Add xalloc.
This reverts part of 0e0f8f12ec241c0f1c1f21f960bb5cf908a0fa3c.
Aurelien Jarno [Wed, 6 Jan 2010 03:27:12 +0000 (20:27 -0700)]
utimens (fdutimens): ignore a negative FD, per contract
* lib/utimens.c (fdutimens) [HAVE_FUTIMENS]: Call futimens only
when we have a valid file descriptor. Otherwise, using a brand
new glibc (with just-patched futimens that now fails with EBADF)
would cause this function to fail with ENOSYS.
Reported by Guillaume Ayoub in http://bugs.debian.org/563726.
See also http://bugzilla.redhat.com/552320.
Jim Meyering [Tue, 5 Jan 2010 14:12:15 +0000 (15:12 +0100)]
maint.mk: include 4 more function names in alloca.h-checking regexp
* top/maint.mk (sc_prohibit_xalloc_without_use): Use more complete
regexp. Before, we would give a false-positive (saying alloca.h
is included unnecessarily) when the only uses involved omitted symbols.
Jim Meyering [Mon, 4 Jan 2010 13:59:04 +0000 (14:59 +0100)]
nl_langinfo: avoid configure-time syntax error
* m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): When we've already tested
for nl_langinfo.h, AC_CHECK_FUNCS_ONCE([nl_langinfo]) expands to
the empty string. Don't let that provoke a shell syntax error.
* lib/regcomp.c (build_equiv_class): From glibc:
Use only the low 24 bits of a findidx return value as an index
into the weights array. Patch by Ulrich Drepper:
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=b7d1c5fa30
* lib/regexec.c (check_node_accept_bytes): Likewise.
* lib/fnmatch_loop.c (FCT): Likewise.
Jim Meyering [Mon, 4 Jan 2010 08:07:52 +0000 (09:07 +0100)]
regcomp: sync from glibc; always use nl_langinfo
* lib/regcomp.c (init_dfa) [!LIBC]: Always use nl_langinfo (CODESET),
now that gnulib provides it. Recognize UTF8 as well as UTF-8.
* lib/regex_internal.h: Always include <langinfo.h>, now.
* modules/regex (Depends-on): Add nl_langinfo.
Eric Blake [Thu, 31 Dec 2009 23:20:15 +0000 (16:20 -0700)]
headers: make check of system header explicit
Exploiting knowledge of internal behavior of other macros can
be dangerous, especially since AC_CHECK_HEADERS_ONCE is designed
to be cheap on subsequent use.
* m4/netdb_h.m4 (gl_HEADER_NETDB): Don't exploit knowledge of
gl_CHECK_NEXT_HEADER internals, but call AC_CHECK_HEADERS_ONCE
ourselves.
* m4/search_h.m4 (gl_SEARCH_H): Likewise.
* m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise.
* m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_BODY): Likewise.
* m4/inttypes.m4 (gl_INTTYPES_H): Likewise, for gt_INTTYPES_PRI
internals.
* m4/wchar.m4 (gl_WCHAR_H): Skip followup test if header is
missing.
Suggested by Bruno Haible.
Eric Blake [Thu, 31 Dec 2009 19:28:35 +0000 (12:28 -0700)]
utimens: avoid shadowing warning
lutimens declared struct stat st in two scopes. Worse, on Linux
kernels between 2.6.18 and 2.6.22 (when utimensat existed, but
rejected AT_SYMLINK_NOFOLLOW) or before 2.6.18 (if the glibc
headers have utimensat, but the kernel does not), it would
result in redundant [fl]stat calls.
* lib/utimens.c (fdutimens, lutimens): Consolidate separate stat
buffers into one, to avoid shadowing, as well as avoiding a
redundant stat.
Reported by Jim Meyering.