merge coreutils 7.6

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34041 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2009-11-14 19:27:05 +00:00
parent bee93957e0
commit 356b0f18b9
317 changed files with 23427 additions and 20325 deletions

View File

@ -1,5 +1,577 @@
2009-09-11 Jim Meyering <meyering@redhat.com>
version 7.6
* NEWS: Record release date.
2009-09-10 Jim Meyering <meyering@redhat.com>
link,ln: use gnulib's link module to work around Solaris 10 deficiency
Before this change, :>f; ln -T f no-such/ would succeed on Solaris 10.
After it, ln fails, as it should: ln: accessing `z/': Not a directory
The command, link f no-such/, had the same problem on that system.
* bootstrap.conf (gnulib_modules): Add "link".
* tests/ln/slash-decorated-nonexistent-dest: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Portability): Mention the improvement.
build: update gnulib submodule to latest
2009-09-10 Ondřej Vašík <ovasik@redhat.com>
doc: improve various BLOCKSIZE and SIZE help
* doc/coreutils.texi (multiplierSuffixes): Mention that
the suffix can be specified without a leading number
* src/split.c (usage): Refactor SIZE help to within a function
* src/truncate.c (usage): Likewise
* src/ls.c (usage): Likewise
* src/df.c (usage): Likewise. Also add a function with BLOCKSIZE help
* src/du.c (usage): Likewise.
* src/system.h: Define 2 functions to emit common help text
This was prompted by https://bugzilla.redhat.com/show_bug.cgi?id=511188
2009-09-10 Jim Meyering <meyering@redhat.com>
dd conv=unblock: print final newline consistently
* src/dd.c (dd_copy) [C_UNBLOCK]: Always print the final newline for
non-empty output, not just when output size is a multiple of cbs.
* doc/coreutils.texi (dd invocation) [conv=unblock]: Mention that dd
prints a newline after each output record, not just when replacing
trailing spaces.
Reported by Ulrich Drepper.
* tests/dd/unblock: New file. Test for this.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
2009-09-09 Jim Meyering <meyering@redhat.com>
maint: make cfg.mk slightly more generic
* cfg.mk (url_dir_list): Don't hard-code "coreutils". Use $(PACKAGE).
2009-09-08 Jim Meyering <meyering@redhat.com>
* gnulib: Update submodule to latest.
tail: make the new piped-stdin test as portable as the old one
* src/tail.c (main): Adapt piped-stdin test to use the same isapipe,
test as was used in the preceding POSIXLY_CORRECT condition.
Remove the now-subsumed POSIXLY_CORRECT test.
Reported by Pádraig Brady.
* doc/coreutils.texi (tail invocation): Document this change.
* NEWS (Changes in behavior): Reclassify, clarify.
2009-09-08 Pádraig Brady <P@draigBrady.com>
tests: tail-2/assert: reduce risk of race condition
* tests/tail2/assert: This reverts commit be853120, 25-08-2009,
"tests: tail-2/assert: avoid risk of race condition"
kill -0 doesn't send a signal and so will only confirm that the
background process was forked, which we know already because
we have its pid.
tests: address a race condition in misc/cat-buf
* tests/misc/cat-buf: Increase the delay between writes
to decrease the chance that dd will read both at once.
Since the test is inherently racy, print a warning via
skip_test_ rather than failing outright.
Reported by Jim Meyering.
2009-09-07 Jim Meyering <meyering@redhat.com>
tail: syntax-only: use "false", rather than equivalent, 0
* src/tail.c (record_open_fd): Initialize "->ignore" to false, not 0.
tail: ignore -f for piped-stdin, as POSIX requires
* src/tail.c (main): Tailing a pipe "forever" is not useful,
and POSIX specifies that tail ignore the -f when there is no
file argument and stdin is a FIFO or pipe. So we do that.
In addition, GNU tail excludes "-" arguments from the list of files
to tail forever, when the associated file descriptor is connected
to a FIFO or pipe. Before this change, ":|tail -f" would hang.
Reported by Ren Yang and Ulrich Drepper.
* tests/tail-2/pipe-f: Test for this.
* tests/tail-2/pipe-f2: Ensure tail doesn't exit early for a fifo.
* tests/Makefile.am (TESTS): Add these tests.
* NEWS (POSIX conformance): Mention it.
2009-09-07 Pádraig Brady <P@draigBrady.com>
tests: tail-2/flush-initial should not rely on stdbuf
* tests/tail-2/flush-initial: stdbuf is not built on all systems.
In any case it's redundant since stdout will automatically be buffered
since we're redirecting to file. So just call tail without using stdbuf.
2009-09-07 Jim Meyering <meyering@redhat.com>
tail: don't give up on inotify mode for an already-ignored "-"
* src/tail.c (main): Adjust today's change to honor the
F[i].ignore flag that may have been set in tail_file.
tests: misc/cat-buf: clean up syntax
* tests/misc/cat-buf: Don't suppress dd's stderr.
Remove useless quotes.
tests: ls/color-clear-to-eol: append NL to accommodate old sed
* tests/ls/color-clear-to-eol: Some vendor sed programs fail
to operate on lines that are not NL-terminated.
This affects at least Solaris 10's /bin/sed.
Reported by Pádraig Brady.
tests: tail-2/infloop-1: avoid rare test failure on a busy system
* tests/tail-2/infloop-1: Sleep 3 seconds, not 1, but in increments
of 0.1 second. Before, this test would fail ~1 time in 20 via
"make -j9 check" on a quad-core system.
Correct comment.
build: update gnulib submodule to latest
doc: tweak NEWS
* NEWS (dd): Tweak wording.
Two blank lines between sections.
tail -f: handle "-"/stdin once again
* src/tail.c (main) [HAVE_INOTIFY]: When stdin (i.e., "-", or no args,
but not /dev/stdin) is specified on the command line, don't use inotify.
Reported by Bill Brelsford in <http://bugs.debian.org/545422>.
* tests/tail-2/follow-stdin: New file. Test for this.
* tests/Makefile.am (TESTS): Add the test.
* NEWS (Bug fixes): Mention it.
This bug was introduced in coreutils-7.5 via commit ae494d4b,
2009-06-02, "tail: use inotify if it is available".
2009-09-06 Jim Meyering <meyering@redhat.com>
tests: tail-2/flush-initial: correct race avoidance code
* tests/tail-2/flush-initial: Wait for the file to be nonempty,
not for the process. Based on a suggestion from Pádraig Brady.
tests: ls-misc: don't let a bogus umask cause test failure
* tests/misc/ls-misc: Set umask to 022. A umask setting permitting
world-write access, e.g., umask o+w, would cause this test to fail.
Report by Mathias Brodala and analysis by Tom Fitzhenry in
<http://bugs.debian.org/544965>.
tail: flush initial output before possibly blocking
* src/tail.c (main): Flush any output from tail_file,
before calling tail_forever_inotify, which can block.
* tests/tail-2/flush-initial: New file. Test for the bug.
* tests/Makefile.am (TESTS): Add tail-2/flush-initial.
* NEWS (Bug fixes): Mention it.
This bug was introduced in coreutils-7.5 via commit ae494d4b,
2009-06-02, "tail: use inotify if it is available".
2009-09-05 Jim Meyering <meyering@redhat.com>
maint: remove unused file: lib/fdopendir-glibc.c
* lib/fdopendir-glibc.c: Remove unused file.
2009-09-05 Jim Meyering <meyering@redhat.com>
tests: ls/stat-vs-dirent: avoid spurious test failure
* tests/ls/stat-vs-dirent: Avoid test failure when run from a
directory whose name (or ancestor directory name) starts with ".".
2009-09-05 Pádraig Brady <P@draigBrady.com>
doc: make the tail --sleep-interval help less confusing
* src/tail.c (usage): I read "approximately S seconds"
as "approximately 5 seconds" for approximately 5 seconds.
maint: remove some tab indentation from copy.c
* src/copy.c (copy_internal): Remove tabs erroneously added
in commit 3346c0af.
tests: test old tail -f method even on systems with inotify
* src/tail.c (main): Add an undocumented ---disable-inotify option
to allow disabling inotify.
* tests/tail-2/pid: Run test in both normal and "disable_inotify" modes.
* tests/tail-2/tail-n0f: Likewise.
* tests/tail-2/wait: Likewise.
* tests/tail-2/append-only: Likewise.
2009-09-05 Jim Meyering <meyering@redhat.com>
build: update gnulib submodule to latest
2009-09-05 Petr Salinger <Petr.Salinger@seznam.cz>
stty: use TAB0, TAB1, and TAB2 only if defined
* src/stty.c (mode_info) [TAB0, TAB1, TAB2]: Guard each
entry with #ifdef. Required for GNU/kFreeBSD.
Reported by Petr Salinger in http://bugs.debian.org/520368.
2009-09-05 Eric Blake <ebb9@byu.net>
build: update from gnulib
* gnulib: Update submodule to latest.
2009-09-04 Eric Blake <ebb9@byu.net>
ln: add comments related to POSIX 2008
* src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Delete.
(do_link): Update comments per POSIX; add FIXME for -L, -P.
mv, cp: tweak LINK_FOLLOWS_SYMLINKS logic
* gnulib: Update to latest gnulib.
* src/copy.c (copy_internal): Adjust comment in light of POSIX
2008, and deal with macro now being tri-state.
2009-09-04 Petr Salinger <Petr.Salinger@seznam.cz>
tests: fix a tail-2/pid failure on GNU/kFreeBSD
* tests/tail-2/wait: Increase the file name recheck frequency to
fix a failure on systems without inotify and a file timestamp precision
of 1 second (like GNU/kFreeBSD).
2009-09-04 Pádraig Brady <P@draigBrady.com>
tests: fix a failure when running tail-2/wait as root
* tests/tail-2/wait: Silently skip a portion of the test
when running as root, rather than failing the whole test.
This regression was introduced with commit 84b5844d, 2009-09-03,
"tests: simplify and fix a race in 2 tail --follow tests".
2009-09-04 Mike Frysinger <vapier@gentoo.org>
build: fix libcap configure flag handling
* m4/jm-macros.m4 (coreutils_MACROS): The code to handle configure-time
enabling or disabling of libcap support was broken. It would treat any
libcap configure option as --disable-libcap because it doesn't check
$enableval at all. This change makes sure we do the sane thing:
--disable-libcap -> disable and don't run any tests
--enable-libcap -> run tests and fail if not found
default -> run tests and warn if not found
2009-09-03 Jim Meyering <meyering@redhat.com>
df: don't fail due to an unreadable argument
* src/df.c (main): If open or fstat fails when we're trying to ensure
that all arg-partitions are automounted, fall back on using stat.
Inspired by the report and patch from Olivier Fourdan in
http://bugzilla.redhat.com/520630.
* NEWS (Bug fixes): Mention it.
* tests/df/unreadable: New test for the above.
* tests/Makefile.am (TESTS): Add df/unreadable.
The bug was introduced in coreutils-7.3 via commit dbd17157,
2009-04-28, "df: use open(2), not stat, to trigger automounting".
2009-09-03 Kamil Dudka <kdudka@redhat.com>
doc: install -C: fix bug in the texi documentation
* doc/coreutils.texi: Move the documentation for install --compare (-C)
from the section on fmt to that for install.
Reported by Florian Schlichting.
2009-09-03 Pádraig Brady <P@draigBrady.com>
tests: simplify and fix a race in 2 tail --follow tests
* tests/tail-2/pid: Use the timeout command to determine process
longevity, rather than querying /proc/$pid/status.
The latter was racy in any case when inotify is used, as then
tail wakes up periodically even for unchanging files therefore
causing the check for "S (sleeping)" state to fail intermittently.
* tests/tail-2/wait: Likewise.
2009-09-03 Ondřej Vašík <ovasik@redhat.com>
cp: don't leak resources for each xattr preservation failure
* src/copy.c (copy_reg): Don't return from the function after an
unsuccessful and required preservation of extended attributes.
This resulted in leaking the copy buffer and file descriptors.
* NEWS (Bug fixes): Mention the fix.
The bug was introduced in coreutils-7.1 via commit 0889381c, 2009-01-23,
"cp/mv: add xattr support".
2009-09-01 Pádraig Brady <P@draigBrady.com>
chcon, chmod, chgrp, chown, du: report fts_close failure
* src/du.c (du_files): Don't fail silently upon fts_close failure.
* src/chcon.c (process_files): Likewise.
* src/chmod.c (process_files): Likewise.
* src/chown-core.c (chown_files): Likewise.
2009-09-01 Jim Meyering <meyering@redhat.com>
build: update from gnulib
* gnulib: Update submodule to latest.
chcon, chmod, chgrp, chown, du: do not ignore fts_close failure
This is probably never visible, but who knows...
* src/chcon.c (process_files): Don't ignore fts_close failure.
* src/chmod.c (process_files): Likewise.
* src/chown-core.c (chown_files): Likewise.
* src/du.c (du_files): Likewise.
maint: du: remove unnecessary initialization
* src/du.c (main): Don't set "skip_file" unnecessarily.
maint: chown, chgrp, chmod, chcon: remove unnecessary initialization
* src/chown-core.c: Include "ignore-value.h".
(change_file_owner): Don't set "ent" only to ignore it.
* src/chcon.c (process_file): Likewise.
* src/chmod.c: Include "ignore-value.h".
(process_file): Don't set "ent" only to ignore it.
After diagnosing root-dev/ino failure, return false immediately:
Now that we don't set "ent" we must be sure not to use it uninitialized,
and there's no point in issuing --verbose-related output in this case.
maint: shred: remove unnecessary initialization
* src/shred.c (genpattern): Value stored to "n" is never used.
maint: dd: remove unnecessary initialization
* src/dd.c (skip): Remove set-but-never-used variable, soffset.
maint: tail: remove unnecessary initialization
* src/tail.c (tail_bytes): Don't compute "diff" twice.
maint: mbsalign.c: remove unnecessary assignment
* gl/lib/mbsalign.c (mbsalign): Remove assignment, the result of which
is never used.
2009-09-01 Pádraig Brady <P@draigBrady.com>
timeout: remove a redundant assignment
* src/timeout.c (main): While keeping argc and argv in
sync may be marginally useful, it is redundant to update argc,
so just remove that to suppress the clang warning.
timeout: defensive handling of all wait() errors
* src/timeout.c (main): Handle all possible cases of unexpected
failures from wait(). This was prompted by the clang tool reporting
the possible non-initialization of the status variable.
2009-09-01 Jim Meyering <meyering@redhat.com>
ls -i: print consistent inode numbers also for mount points
On most unix- and linux-based kernels, ls -i DIR_CONTAINING_MOUNT_POINT
would print the wrong inode number for any entry that is a mount point.
It would do that by relying on readdir's dirent.d_ino values, while
most readdir implementations return the inode number of the underlying,
inaccessible directory. Thus, it is not consistent with what you'd
get when applying stat to the same entry. This bug led to surprising
results like "ls -i" and "ls -i --color" printing different numbers (ls
must usually "stat" a file to colorize its name). This change makes it
so that on offending systems, ls must stat non-command-line-arguments
for which otherwise it would be able to use "for free" dirent.d_ino
values. Regardless of this change, ls is already required to stat every
command-line argument. Note: versions of GNU ls prior to coreutils-6.0
did not perform the invalid optimization, and hence always printed
correct inode numbers. Thus, for the sake of correctness, ls -i is
forgoing the readdir optimization, for any kernel (including linux!)
with POSIX-nonconforming readdir. Note that currently, only Cygwin has
been agile enough to conform.
* src/ls.c (RELIABLE_D_INO): Define.
(print_dir): Use it.
For plenty of discussion, see this long thread:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14020
This bug was introduced by the 2006-02-26 commit, 33eb3efe:
"In ls, avoid calling stat for --inode (-i), when possible."
* tests/ls/readdir-mountpoint-inode: New test.
* tests/Makefile.am (TESTS): Add it.
* tests/ls/stat-vs-dirent: Don't suppress failure of this test,
now that ls -i is fixed. Though note that it doesn't test well,
since it compares only the always-stat'd command-line arguments.
* NEWS (Bug fixes): Mention it.
2009-08-31 Jim Meyering <meyering@redhat.com>
maint: revert my stdbuf change: the result didn't even compile
This reverts commit c1e158489d88bad418d52ceadf37af0b6f5b2112.
2009-08-30 Jim Meyering <meyering@redhat.com>
maint: stdbuf: move a declaration; no-semantic-change
* src/stdbuf.c (set_program_path): Move a declaration down into
the scope where it's used.
build: quiet "make check" in src/
* src/Makefile.am (check-duplicate-no-install): Use $(AM_V_GEN).
(check-README): Likewise. And $(AM_V_at).
doc: cp: update note on preserving symlink time stamps
* doc/coreutils.texi (cp invocation): Now, we *do* preserve time
stamps on symlinks, when possible.
build: update bootstrap from gnulib
* bootstrap: Merge from gnulib.
2009-08-30 Pádraig Brady <P@draigBrady.com>
tests: don't misbehave if $TMPDIR contains spaces
* tests/misc/xattr: Add quotes.
* tests/mv/acl: Likewise.
* tests/mv/backup-is-src: Likewise.
* tests/mv/hard-link-1: Likewise.
* tests/mv/leak-fd: Likewise.
* tests/mv/mv-special-1: Likewise.
* tests/mv/part-fail: Likewise.
* tests/mv/part-hardlink: Likewise.
* tests/mv/part-rename: Likewise.
* tests/mv/part-symlink: Likewise.
* tests/mv/partition-perm: Likewise.
* tests/mv/sticky-to-xpart: Likewise.
2009-08-29 Jim Meyering <meyering@redhat.com>
tests: other-fs-tmpdir: don't misbehave for quote-unfriendly $TMPDIR
* tests/other-fs-tmpdir: Quote uses of variables that might expand
to strings containing e.g., whitespace.
build: update from gnulib
* gnulib: Update submodule to latest.
tests: move a coreutils-specific test from maint.mk to Makefile.am
* Makefile.am (distcheck-hook): Make taint-distcheck here, since it's
no longer done via maint.mk.
tests: cp/reflink-auto guard against a pathological $TMPDIR
* tests/cp/reflink-auto: Add quotes.
2009-08-29 Pádraig Brady <P@draigBrady.com>
cp --reflink: preserve attributes on cloned files if asked
* src/copy.c (copy_reg): When cloning only skip the data copying
* tests/cp/reflink-perm: New test to check times and modes copied
* tests/Makefile.am: Reference the new test
* NEWS: Mention the fix
cp --reflink: add an "auto" parameter to fall back to a normal copy
* doc/coreutils.texi (cp invocation): Document the new
"auto" and "always" options to --reflink.
* src/copy.c (copy_reg): Fall back to a standard copy
when reflink() is not supported and --reflink=auto specified.
* src/copy.h [struct cp_options] (reflink): Change type s/bool/enum/.
* src/cp.c (usage): Describe the --reflink={always,auto} options
and expand a little on what --reflink does.
(main): parse the new parameters to --reflink and allow all
--sparse options with --reflink=auto.
* src/install.c (cp_option_init): Init the enum instead of bool.
* src/mv.c (cp_option_init): Likewise.
* tests/cp/reflink-auto: A new test for falling back to normal copy.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the new feature.
stdbuf: fix a small typo in --help output
* src/stdbuf.c (usage): s/then/the/
2009-08-28 Eric Blake <ebb9@byu.net>
build: avoid unused variable warnings on cygwin
* src/copy.c (clone_file, copy_attr_by_fd, copy_attr_by_name):
Mark up unused variables.
* src/remove.c (dirent_inode_sort_may_be_useful): Likewise.
dd: detect closed stderr
* src/dd.c (maybe_close_stdout): Always flush stderr; regression
introduced in commit 381e69ea.
* tests/misc/close-stdout (p): Use consistent style.
* tests/dd/stderr: New test, borrowing from misc/close-stdout.
* tests/Makefile.am (TESTS): Run it.
* NEWS: Mention this.
2009-08-28 Jim Meyering <meyering@redhat.com>
maint: ignore only man/*.1, not all *.1 files
* .gitignore: Ignore *.1 only in man/
2009-08-27 Jim Meyering <meyering@redhat.com>
build: prefix a few rules with $(AM_V_GEN)
* Makefile.am (.version, dist-hook, gen-ChangeLog): Use $(AM_V_GEN)
and $(AM_V_at), so that automake's silent-rules option (make V=1/V=0)
now controls whether the commands are printed at build time.
(THANKS-to-translators, check-ls-dircolors): Likewise.
2009-08-26 Jim Meyering <meyering@redhat.com>
build: stop earlier if touching ChangeLog fails
* bootstrap.conf: Exit right away if touching ChangeLog fails.
Otherwise, the touch failure message is buried under configure output.
tests: mkdir/selinux: avoid spurious failure on some SELinux systems
* tests/test-lib.sh (require_selinux_enforcing_): New function.
* tests/mkdir/selinux: Use it.
Otherwise, this test would fail on Rawhide with SELinux disabled.
tests: tail-2/assert: avoid risk of race condition
* tests/tail-2/assert: Avoid spurious failure due to race condition.
Rather than sleeping for 1 second and crossing fingers,
wait explicitly for backgrounded tail process to start.
Otherwise, this test would fail under heavy load.
2009-08-25 Jim Meyering <meyering@redhat.com>
maint: ensure we don't embed Emacs indent-tabs-mode setting lines
Now that we prohibit indentation via TABs, there's no need for
Emacs indent-tabs-mode setting lines, so prohibit those, too.
* cfg.mk (sc_prohibit_emacs__indent_tabs_mode__setting): New rule.
maint: remove Local Variables: indent-tabs-mode: nil from all sources
* src/getlimits.c: Likewise.
* src/group-list.c: Likewise.
* src/groups.c: Likewise.
* src/mktemp.c: Likewise.
* src/setuidgid.c: Likewise.
* src/stdbuf.c: Likewise.
* src/timeout.c: Likewise.
* src/truncate.c: Likewise.
* gl/lib/mbsalign.c: Likewise.
* tests/test-lib.sh: Likewise.
* bootstrap: Likewise.
* README-hacking: Likewise.
doc: HACKING: mention the new space-only indentation policy
maint: teach "make syntax-check" the space-only indentation rule
* cfg.mk (sc_prohibit_tab_based_indentation): New rule.
* .x-sc_prohibit_tab_based_indentation: New file.
* Makefile.am (syntax_check_exceptions): Add file,
.x-sc_prohibit_tab_based_indentation.
global: convert indentation-TABs to spaces
Transformed via this shell code:
t=$'\t'
git ls-files \
| grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \
| grep -vE 'tests/pr/|help2man' \
| xargs grep -lE "^ *$t" \
| xargs perl -MText::Tabs -ni -le \
'$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
2009-08-24 Jim Meyering <meyering@redhat.com>
cp: ignore obscure failure to preserve symlink time stamps,
...when run on a kernel older than what was implied by headers and
libraries tested at configure time.
* src/copy.c (utimens_symlink): Ignore failure when errno == ENOSYS.
* NEWS (Bug fixes): Mention it.
Reported by Todd Zullinger and Kamil Dudka.
Details in this thread:
http://thread.gmane.org/gmane.linux.redhat.fedora.devel/119834
2009-08-23 Jim Meyering <meyering@redhat.com>
tests: skip (don't fail) a cp test, upon mount-related failure
* tests/cp/cp-mv-enotsup-xattr: Upon a set-up failiure, rather than
failing the test with a "framework failure" diagnostic, just skip it.
Russell Whitaker reported that this test failed on slackware.
build: update from *public* gnulib
* gnulib: Update submodule to latest.
Kamil Dudka reported that bootstrap was broken.
2009-08-22 Jim Meyering <meyering@redhat.com>
build: update from gnulib
* gnulib: Update submodule to latest.
2009-08-20 Jim Meyering <meyering@redhat.com>
post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
version 7.5
* NEWS: Record release date.

View File

@ -49,6 +49,7 @@ syntax_check_exceptions = \
.x-sc_prohibit_atoi_atof \
.x-sc_prohibit_stat_st_blocks \
.x-sc_prohibit_strcmp \
.x-sc_prohibit_tab_based_indentation \
.x-sc_require_config_h \
.x-sc_require_config_h_first \
.x-sc_space_tab \
@ -97,20 +98,20 @@ rm_subst = \
BUILT_SOURCES = .version
.version:
echo $(VERSION) > $@-t && mv $@-t $@
$(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
# Arrange so that .tarball-version appears only in the distribution
# tarball, and never in a checked-out repository.
# The perl substitution is to change some key uses of "rm" to "/bin/rm".
# See the rm_subst comment for details.
dist-hook: gen-ChangeLog
echo $(VERSION) > $(distdir)/.tarball-version
perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
$(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
gen_start_date = 2008-02-08
.PHONY: gen-ChangeLog
gen-ChangeLog:
if test -d .git; then \
$(AM_V_GEN)if test -d .git; then \
$(top_srcdir)/build-aux/gitlog-to-changelog \
--since=$(gen_start_date) > $(distdir)/cl-t; \
rm -f $(distdir)/ChangeLog; \
@ -120,11 +121,12 @@ gen-ChangeLog:
ALL_RECURSIVE_TARGETS += distcheck-hook
distcheck-hook: check-ls-dircolors
$(MAKE) my-distcheck
$(MAKE) taint-distcheck
DISTCLEANFILES = VERSION
MAINTAINERCLEANFILES = THANKS-to-translators
THANKS-to-translators: po/LINGUAS THANKStt.in
( \
$(AM_V_GEN)( \
cat $(srcdir)/THANKStt.in; \
for lang in `cat $(srcdir)/po/LINGUAS`; do \
echo http://translationproject.org/team/$$lang.html; \
@ -135,7 +137,7 @@ THANKS-to-translators: po/LINGUAS THANKStt.in
# remain in sync.
.PHONY: check-ls-dircolors
check-ls-dircolors:
dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \
$(AM_V_GEN)dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \
$(srcdir)/src/dircolors.c \
|sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
|sed -n 's/^"\(..\)"/\1/p'|sort -u); \

View File

@ -76,22 +76,23 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
$(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/cycle-check.m4 \
$(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \
$(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
$(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \
$(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
$(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
$(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
$(top_srcdir)/m4/euidaccess-stat.m4 \
$(top_srcdir)/m4/dirent-safer.m4 $(top_srcdir)/m4/dirent_h.m4 \
$(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
$(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \
$(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
$(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \
$(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/euidaccess-stat.m4 \
$(top_srcdir)/m4/euidaccess.m4 $(top_srcdir)/m4/exclude.m4 \
$(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/exponentd.m4 \
$(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \
$(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \
$(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-safer.m4 \
$(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fd-reopen.m4 \
$(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/file-type.m4 \
$(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/filemode.m4 \
$(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \
$(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \
$(top_srcdir)/m4/fdopendir.m4 $(top_srcdir)/m4/fflush.m4 \
$(top_srcdir)/m4/file-type.m4 $(top_srcdir)/m4/fileblocks.m4 \
$(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/filenamecat.m4 \
$(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
$(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fopen.m4 \
$(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \
$(top_srcdir)/m4/fprintftime.m4 $(top_srcdir)/m4/fpurge.m4 \
$(top_srcdir)/m4/freading.m4 $(top_srcdir)/m4/frexp.m4 \
@ -133,37 +134,38 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/lib-check.m4 $(top_srcdir)/m4/lib-ignore.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/link-follow.m4 \
$(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
$(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
$(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/long-options.m4 \
$(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ls-mntd-fs.m4 \
$(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
$(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
$(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \
$(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
$(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \
$(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \
$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbswidth.m4 \
$(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memcasecmp.m4 \
$(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \
$(top_srcdir)/m4/memcoll.m4 $(top_srcdir)/m4/memcpy.m4 \
$(top_srcdir)/m4/memmove.m4 $(top_srcdir)/m4/mempcpy.m4 \
$(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/memset.m4 \
$(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mgetgroups.m4 \
$(top_srcdir)/m4/mkancesdirs.m4 $(top_srcdir)/m4/mkdir-p.m4 \
$(top_srcdir)/m4/mkdir-slash.m4 $(top_srcdir)/m4/mkstemp.m4 \
$(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \
$(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/modechange.m4 \
$(top_srcdir)/m4/mountlist.m4 $(top_srcdir)/m4/mpsort.m4 \
$(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nanosleep.m4 \
$(top_srcdir)/m4/netdb_h.m4 $(top_srcdir)/m4/netinet_in_h.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \
$(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \
$(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perl.m4 \
$(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/physmem.m4 \
$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix-shell.m4 \
$(top_srcdir)/m4/posixtm.m4 $(top_srcdir)/m4/posixver.m4 \
$(top_srcdir)/m4/prereq.m4 $(top_srcdir)/m4/printf-frexp.m4 \
$(top_srcdir)/m4/link.m4 $(top_srcdir)/m4/localcharset.m4 \
$(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \
$(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \
$(top_srcdir)/m4/long-options.m4 $(top_srcdir)/m4/longlong.m4 \
$(top_srcdir)/m4/ls-mntd-fs.m4 $(top_srcdir)/m4/lseek.m4 \
$(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \
$(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \
$(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbchar.m4 \
$(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrlen.m4 \
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
$(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \
$(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/md5.m4 \
$(top_srcdir)/m4/memcasecmp.m4 $(top_srcdir)/m4/memchr.m4 \
$(top_srcdir)/m4/memcmp.m4 $(top_srcdir)/m4/memcoll.m4 \
$(top_srcdir)/m4/memcpy.m4 $(top_srcdir)/m4/memmove.m4 \
$(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
$(top_srcdir)/m4/memset.m4 $(top_srcdir)/m4/memxfrm.m4 \
$(top_srcdir)/m4/mgetgroups.m4 $(top_srcdir)/m4/mkancesdirs.m4 \
$(top_srcdir)/m4/mkdir-p.m4 $(top_srcdir)/m4/mkdir-slash.m4 \
$(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mktime.m4 \
$(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
$(top_srcdir)/m4/modechange.m4 $(top_srcdir)/m4/mountlist.m4 \
$(top_srcdir)/m4/mpsort.m4 $(top_srcdir)/m4/multiarch.m4 \
$(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netdb_h.m4 \
$(top_srcdir)/m4/netinet_in_h.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/open.m4 \
$(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \
$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/perror.m4 \
$(top_srcdir)/m4/physmem.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/posix-shell.m4 $(top_srcdir)/m4/posixtm.m4 \
$(top_srcdir)/m4/posixver.m4 $(top_srcdir)/m4/prereq.m4 \
$(top_srcdir)/m4/printf-frexp.m4 \
$(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \
$(top_srcdir)/m4/priv-set.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \
@ -352,6 +354,7 @@ GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GNULIB_ACCEPT = @GNULIB_ACCEPT@
GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
GNULIB_ATOLL = @GNULIB_ATOLL@
GNULIB_BIND = @GNULIB_BIND@
@ -365,10 +368,15 @@ GNULIB_CONNECT = @GNULIB_CONNECT@
GNULIB_DIRFD = @GNULIB_DIRFD@
GNULIB_DPRINTF = @GNULIB_DPRINTF@
GNULIB_DUP2 = @GNULIB_DUP2@
GNULIB_DUP3 = @GNULIB_DUP3@
GNULIB_ENVIRON = @GNULIB_ENVIRON@
GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
GNULIB_FCHDIR = @GNULIB_FCHDIR@
GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
GNULIB_FCLOSE = @GNULIB_FCLOSE@
GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
GNULIB_FFLUSH = @GNULIB_FFLUSH@
GNULIB_FLOORF = @GNULIB_FLOORF@
GNULIB_FLOORL = @GNULIB_FLOORL@
@ -383,6 +391,7 @@ GNULIB_FREXP = @GNULIB_FREXP@
GNULIB_FREXPL = @GNULIB_FREXPL@
GNULIB_FSEEK = @GNULIB_FSEEK@
GNULIB_FSEEKO = @GNULIB_FSEEKO@
GNULIB_FSTATAT = @GNULIB_FSTATAT@
GNULIB_FSYNC = @GNULIB_FSYNC@
GNULIB_FTELL = @GNULIB_FTELL@
GNULIB_FTELLO = @GNULIB_FTELLO@
@ -446,12 +455,19 @@ GNULIB_MEMCHR = @GNULIB_MEMCHR@
GNULIB_MEMMEM = @GNULIB_MEMMEM@
GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
GNULIB_MKNODAT = @GNULIB_MKNODAT@
GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
GNULIB_OPEN = @GNULIB_OPEN@
GNULIB_OPENAT = @GNULIB_OPENAT@
GNULIB_PERROR = @GNULIB_PERROR@
GNULIB_PIPE2 = @GNULIB_PIPE2@
GNULIB_POPEN = @GNULIB_POPEN@
GNULIB_PRINTF = @GNULIB_PRINTF@
GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
GNULIB_PUTC = @GNULIB_PUTC@
@ -461,9 +477,11 @@ GNULIB_PUTS = @GNULIB_PUTS@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
GNULIB_READLINKAT = @GNULIB_READLINKAT@
GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
GNULIB_RECV = @GNULIB_RECV@
GNULIB_RECVFROM = @GNULIB_RECVFROM@
GNULIB_RENAME = @GNULIB_RENAME@
GNULIB_ROUND = @GNULIB_ROUND@
GNULIB_ROUNDF = @GNULIB_ROUNDF@
GNULIB_ROUNDL = @GNULIB_ROUNDL@
@ -503,11 +521,13 @@ GNULIB_STRTOLL = @GNULIB_STRTOLL@
GNULIB_STRTOULL = @GNULIB_STRTOULL@
GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
GNULIB_TRUNC = @GNULIB_TRUNC@
GNULIB_TRUNCF = @GNULIB_TRUNCF@
GNULIB_TRUNCL = @GNULIB_TRUNCL@
GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
GNULIB_UNSETENV = @GNULIB_UNSETENV@
GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
@ -524,6 +544,7 @@ GNULIB_WCTOB = @GNULIB_WCTOB@
GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
GNULIB_WRITE = @GNULIB_WRITE@
GREP = @GREP@
HAVE_ACCEPT4 = @HAVE_ACCEPT4@
HAVE_ALPHASORT = @HAVE_ALPHASORT@
HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
HAVE_ATOLL = @HAVE_ATOLL@
@ -574,8 +595,14 @@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
HAVE_DPRINTF = @HAVE_DPRINTF@
HAVE_DUP2 = @HAVE_DUP2@
HAVE_DUP3 = @HAVE_DUP3@
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
HAVE_FACCESSAT = @HAVE_FACCESSAT@
HAVE_FCHMODAT = @HAVE_FCHMODAT@
HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
HAVE_FSEEKO = @HAVE_FSEEKO@
HAVE_FSTATAT = @HAVE_FSTATAT@
HAVE_FSYNC = @HAVE_FSYNC@
HAVE_FTELLO = @HAVE_FTELLO@
HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
@ -601,15 +628,22 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
HAVE_MEMPCPY = @HAVE_MEMPCPY@
HAVE_MKDIRAT = @HAVE_MKDIRAT@
HAVE_MKDTEMP = @HAVE_MKDTEMP@
HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
HAVE_MKNODAT = @HAVE_MKNODAT@
HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
HAVE_NETDB_H = @HAVE_NETDB_H@
HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
HAVE_PIPE2 = @HAVE_PIPE2@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
HAVE_READLINK = @HAVE_READLINK@
HAVE_READLINKAT = @HAVE_READLINKAT@
HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
HAVE_RPMATCH = @HAVE_RPMATCH@
HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
@ -627,7 +661,6 @@ HAVE_STPCPY = @HAVE_STPCPY@
HAVE_STPNCPY = @HAVE_STPNCPY@
HAVE_STRCASESTR = @HAVE_STRCASESTR@
HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
HAVE_STRNDUP = @HAVE_STRNDUP@
HAVE_STRPBRK = @HAVE_STRPBRK@
HAVE_STRSEP = @HAVE_STRSEP@
HAVE_STRTOD = @HAVE_STRTOD@
@ -639,6 +672,8 @@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
HAVE_SYMLINK = @HAVE_SYMLINK@
HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
@ -650,6 +685,7 @@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
HAVE_UNISTD_H = @HAVE_UNISTD_H@
HAVE_UNLINKAT = @HAVE_UNLINKAT@
HAVE_UNSETENV = @HAVE_UNSETENV@
HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
HAVE_VASPRINTF = @HAVE_VASPRINTF@
@ -802,6 +838,7 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
REPLACE_DPRINTF = @REPLACE_DPRINTF@
REPLACE_DUP2 = @REPLACE_DUP2@
REPLACE_FCHDIR = @REPLACE_FCHDIR@
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
REPLACE_FCLOSE = @REPLACE_FCLOSE@
REPLACE_FFLUSH = @REPLACE_FFLUSH@
REPLACE_FLOORF = @REPLACE_FLOORF@
@ -814,6 +851,7 @@ REPLACE_FREXP = @REPLACE_FREXP@
REPLACE_FREXPL = @REPLACE_FREXPL@
REPLACE_FSEEK = @REPLACE_FSEEK@
REPLACE_FSEEKO = @REPLACE_FSEEKO@
REPLACE_FSTATAT = @REPLACE_FSTATAT@
REPLACE_FTELL = @REPLACE_FTELL@
REPLACE_FTELLO = @REPLACE_FTELLO@
REPLACE_GETCWD = @REPLACE_GETCWD@
@ -830,6 +868,7 @@ REPLACE_ISNAN = @REPLACE_ISNAN@
REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
REPLACE_LCHOWN = @REPLACE_LCHOWN@
REPLACE_LDEXPL = @REPLACE_LDEXPL@
REPLACE_LINK = @REPLACE_LINK@
REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
REPLACE_LSEEK = @REPLACE_LSEEK@
REPLACE_LSTAT = @REPLACE_LSTAT@
@ -850,8 +889,10 @@ REPLACE_NULL = @REPLACE_NULL@
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
REPLACE_OPEN = @REPLACE_OPEN@
REPLACE_PERROR = @REPLACE_PERROR@
REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
REPLACE_RENAME = @REPLACE_RENAME@
REPLACE_ROUND = @REPLACE_ROUND@
REPLACE_ROUNDF = @REPLACE_ROUNDF@
REPLACE_ROUNDL = @REPLACE_ROUNDL@
@ -864,10 +905,12 @@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
REPLACE_STRPTIME = @REPLACE_STRPTIME@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TRUNCL = @REPLACE_TRUNCL@
REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
@ -900,13 +943,13 @@ SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
SYS_SELECT_H = @SYS_SELECT_H@
SYS_SOCKET_H = @SYS_SOCKET_H@
SYS_STAT_H = @SYS_STAT_H@
SYS_TIME_H = @SYS_TIME_H@
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
U = @U@
UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
USE_ACL = @USE_ACL@
@ -1013,6 +1056,7 @@ syntax_check_exceptions = \
.x-sc_prohibit_atoi_atof \
.x-sc_prohibit_stat_st_blocks \
.x-sc_prohibit_strcmp \
.x-sc_prohibit_tab_based_indentation \
.x-sc_require_config_h \
.x-sc_require_config_h_first \
.x-sc_space_tab \
@ -1534,18 +1578,18 @@ install-root:
check-root:
cd tests && $(MAKE) $@ SUBDIRS=
.version:
echo $(VERSION) > $@-t && mv $@-t $@
$(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
# Arrange so that .tarball-version appears only in the distribution
# tarball, and never in a checked-out repository.
# The perl substitution is to change some key uses of "rm" to "/bin/rm".
# See the rm_subst comment for details.
dist-hook: gen-ChangeLog
echo $(VERSION) > $(distdir)/.tarball-version
perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
$(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
.PHONY: gen-ChangeLog
gen-ChangeLog:
if test -d .git; then \
$(AM_V_GEN)if test -d .git; then \
$(top_srcdir)/build-aux/gitlog-to-changelog \
--since=$(gen_start_date) > $(distdir)/cl-t; \
rm -f $(distdir)/ChangeLog; \
@ -1553,8 +1597,9 @@ gen-ChangeLog:
fi
distcheck-hook: check-ls-dircolors
$(MAKE) my-distcheck
$(MAKE) taint-distcheck
THANKS-to-translators: po/LINGUAS THANKStt.in
( \
$(AM_V_GEN)( \
cat $(srcdir)/THANKStt.in; \
for lang in `cat $(srcdir)/po/LINGUAS`; do \
echo http://translationproject.org/team/$$lang.html; \
@ -1565,7 +1610,7 @@ THANKS-to-translators: po/LINGUAS THANKStt.in
# remain in sync.
.PHONY: check-ls-dircolors
check-ls-dircolors:
dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \
$(AM_V_GEN)dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \
$(srcdir)/src/dircolors.c \
|sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
|sed -n 's/^"\(..\)"/\1/p'|sort -u); \

View File

@ -1,5 +1,72 @@
GNU coreutils NEWS -*- outline -*-
* Noteworthy changes in release 7.6 (2009-09-11) [stable]
** Bug fixes
cp, mv now ignore failure to preserve a symlink time stamp, when it is
due to their running on a kernel older than what was implied by headers
and libraries tested at configure time.
[bug introduced in coreutils-7.5]
cp --reflink --preserve now preserves attributes when cloning a file.
[bug introduced in coreutils-7.5]
cp --preserve=xattr no longer leaks resources on each preservation failure.
[bug introduced in coreutils-7.1]
dd now exits with non-zero status when it encounters a write error while
printing a summary to stderr.
[bug introduced in coreutils-6.11]
dd cbs=N conv=unblock would fail to print a final newline when the size
of the input was not a multiple of N bytes.
[the non-conforming behavior dates back to the initial implementation]
df no longer requires that each command-line argument be readable
[bug introduced in coreutils-7.3]
ls -i now prints consistent inode numbers also for mount points.
This makes ls -i DIR less efficient on systems with dysfunctional readdir,
because ls must stat every file in order to obtain a guaranteed-valid
inode number. [bug introduced in coreutils-6.0]
tail -f (inotify-enabled) now flushes any initial output before blocking.
Before, this would print nothing and wait: stdbuf -o 4K tail -f /etc/passwd
Note that this bug affects tail -f only when its standard output is buffered,
which is relatively unusual.
[bug introduced in coreutils-7.5]
tail -f once again works with standard input. inotify-enabled tail -f
would fail when operating on a nameless stdin. I.e., tail -f < /etc/passwd
would say "tail: cannot watch `-': No such file or directory", yet the
relatively baroque tail -f /dev/stdin < /etc/passwd would work. Now, the
offending usage causes tail to revert to its conventional sleep-based
(i.e., not inotify-based) implementation.
[bug introduced in coreutils-7.5]
** Portability
ln, link: link f z/ would mistakenly succeed on Solaris 10, given an
existing file, f, and nothing named "z". ln -T f z/ has the same problem.
Each would mistakenly create "z" as a link to "f". Now, even on such a
system, each command reports the error, e.g.,
link: cannot create link `z/' to `f': Not a directory
** New features
cp --reflink accepts a new "auto" parameter which falls back to
a standard copy if creating a copy-on-write clone is not possible.
** Changes in behavior
tail -f now ignores "-" when stdin is a pipe or FIFO.
tail-with-no-args now ignores -f unconditionally when stdin is a pipe or FIFO.
Before, it would ignore -f only when no file argument was specified,
and then only when POSIXLY_CORRECT was set. Now, :|tail -f - terminates
immediately. Before, it would block indefinitely.
* Noteworthy changes in release 7.5 (2009-08-20) [stable]
** Bug fixes

View File

@ -78,6 +78,7 @@ Bernhard Rosenkraenzer bero@redhat.de
Bernhard Voelker bernhard.voelker@siemens-enterprise.com
Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be
Bert Wesarg bert.wesarg@googlemail.com
Bill Brelsford wb@k2di.net
Bill Peters peters@gaffel.as.arizona.edu
Bjorn Helgaas helgaas@rsn.hp.com
Bob McCracken kerouac@ravenet.com
@ -185,6 +186,7 @@ Felix Rauch Valenti frauch@cse.unsw.edu.au
Ferdinand fw@scenic.mine.nu
Fletcher Mattox fletcher@cs.utexas.edu
Florent Bayle florent@sarcelle.net
Florian Schlichting fschlich@cis.fu-berlin.de
Florin Iucha fiucha@hsys.mic.ro
Francesco Montorsi fr_m@hotmail.com
François Pinard pinard@iro.umontreal.ca
@ -385,6 +387,7 @@ Matthew Swift swift@alum.mit.edu
Matthew Woehlke mw_triad@users.sourceforge.net
Matthias Urlichs smurf@noris.de
Matti Aarnio matti.aarnio@zmailer.org
Mathias Brodala info@noctus.net
Mattias Wadenstein maswan@acc.umu.se
Max Chang maxchang@ucla.edu
Meelis Roos mroos@tartu.cyber.ee
@ -439,6 +442,7 @@ Olatunji Oluwabukunmi Ruwase tjruwase@stanford.edu
Olav Morkrid olav@funcom.com
Ole Laursen olau@hardworking.dk
Oliver Kiddle okiddle@yahoo.co.uk
Olivier Fourdan ofourdan@redhat.com
Ørn E. Hansen oehansen@daimi.aau.dk
Oskar Liljeblad osk@hem.passagen.se
Otavio Salvador otavio@ossystems.com.br
@ -486,6 +490,7 @@ Ralph Loader loader@maths.ox.ac.uk
Raul Miller moth@magenta.com
Raúl Núñez de Arenas Coronado raul@pleyades.net
Reuben Thomas rrt@sc3d.org
Ren Yang ryang@redhat.com
Richard A Downing richard.downing@bcs.org.uk
Richard Braakman dark@xs4all.nl
Richard Dawe rich@phekda.freeserve.co.uk
@ -560,6 +565,7 @@ Tim Waugh twaugh@redhat
Tobias Stoeckmann tobias@bugol.de
Toby Peterson toby@opendarwin.org
Todd A. Jacobs tjacobs@codegnome.org
Tom Fitzhenry tom@tom-fitzhenry.me.uk
Tom Haynes thomas@netapp.com
Tom Quinn trq@dionysos.thphys.ox.ac.uk
Tomas Pospisek tpo@sourcepole.ch

View File

@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64.16-4cdf58],,
[m4_warning([this file was generated for autoconf 2.64.16-4cdf58.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64.27-5b5d],,
[m4_warning([this file was generated for autoconf 2.64.27-5b5d.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
@ -804,22 +804,19 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008, 2009
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# serial 6
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@ -839,23 +836,30 @@ esac
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
for am_try in 1 2; do
echo timestamp > conftest.file
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
if test "$[2]" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
done
test "$[2]" = conftest.file
)
then
@ -1068,6 +1072,7 @@ m4_include([m4/config-h.m4])
m4_include([m4/cycle-check.m4])
m4_include([m4/d-ino.m4])
m4_include([m4/d-type.m4])
m4_include([m4/dirent-safer.m4])
m4_include([m4/dirent_h.m4])
m4_include([m4/dirfd.m4])
m4_include([m4/dirname.m4])
@ -1091,6 +1096,7 @@ m4_include([m4/fclose.m4])
m4_include([m4/fcntl-safer.m4])
m4_include([m4/fcntl_h.m4])
m4_include([m4/fd-reopen.m4])
m4_include([m4/fdopendir.m4])
m4_include([m4/fflush.m4])
m4_include([m4/file-type.m4])
m4_include([m4/fileblocks.m4])
@ -1099,6 +1105,7 @@ m4_include([m4/filenamecat.m4])
m4_include([m4/flexmember.m4])
m4_include([m4/float_h.m4])
m4_include([m4/fnmatch.m4])
m4_include([m4/fopen.m4])
m4_include([m4/fpending.m4])
m4_include([m4/fpieee.m4])
m4_include([m4/fprintftime.m4])
@ -1175,6 +1182,7 @@ m4_include([m4/lib-ld.m4])
m4_include([m4/lib-link.m4])
m4_include([m4/lib-prefix.m4])
m4_include([m4/link-follow.m4])
m4_include([m4/link.m4])
m4_include([m4/localcharset.m4])
m4_include([m4/locale-fr.m4])
m4_include([m4/locale-ja.m4])

View File

@ -34,7 +34,7 @@ bt_regex=`echo "$bt"| sed 's/\./[.]/g'`
bt2=${bt}2
usage() {
echo >&2 "\
cat <<EOF
Usage: $0 [OPTION]...
Bootstrap this package from the checked-out sources.
@ -56,7 +56,7 @@ For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
are honored.
Running without arguments will suffice in most cases.
"
EOF
}
# Configuration.
@ -148,6 +148,37 @@ copy=false
# on which version control system (if any) is used in the source directory.
vc_ignore=auto
# find_tool ENVVAR NAMES...
# -------------------------
find_tool ()
{
# Find sha1sum, named gsha1sum on MacPorts.
find_tool_envvar=$1
shift
if eval test x"\$$find_tool_envvar" = x; then
for i
do
if ($i --version </dev/null) >/dev/null 2>&1; then
find_tool_res=$i
break
fi
done
fi
if test x"$find_tool_res" = x; then
echo >&2 "$0: $find_tool_name is required"
exit 1
fi
($find_tool_res --version </dev/null) >/dev/null 2>&1 || {
echo >&2 "$0: cannot run $find_tool_res --version"
exit 1
}
eval "$find_tool_envvar=\"$find_tool_res\""
eval "export $find_tool_envvar"
}
# Find sha1sum, named gsha1sum on MacPorts.
find_tool SHA1SUM sha1sum gsha1sum
# Override the default configuration, if necessary.
# Make sure that bootstrap.conf is sourced from the current directory
# if we were invoked as "sh bootstrap".
@ -420,11 +451,11 @@ update_po_files() {
cksum_file="$ref_po_dir/$po.s1"
if ! test -f "$cksum_file" ||
! test -f "$po_dir/$po.po" ||
! ${SHA1SUM-sha1sum} -c --status "$cksum_file" \
! $SHA1SUM -c --status "$cksum_file" \
< "$new_po" > /dev/null; then
echo "updated $po_dir/$po.po..."
cp "$new_po" "$po_dir/$po.po" \
&& ${SHA1SUM-sha1sum} < "$new_po" > "$cksum_file"
&& $SHA1SUM < "$new_po" > "$cksum_file"
fi
done
}
@ -765,7 +796,3 @@ sed 's,\.\./\.\.,..,g' $m > $m-t
mv -f $m-t $m
echo "$0: done. Now you can run './configure'."
# Local Variables:
# indent-tabs-mode: nil
# End:

View File

@ -130,6 +130,7 @@ gnulib_modules="
lchown
lib-ignore
linebuffer
link
link-follow
long-options
lstat
@ -316,4 +317,4 @@ tar -
"
# Automake requires that ChangeLog exist.
touch ChangeLog
touch ChangeLog || exit 1

File diff suppressed because it is too large Load Diff

View File

@ -24,8 +24,8 @@ AC_PREREQ([2.61])
# indicates that it is built from the 219th delta (in _some_ repository)
# following the v6.9 tag, and that 58ddd is a prefix of the commit SHA1.
AC_INIT([GNU coreutils],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[bug-coreutils@gnu.org])
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[bug-coreutils@gnu.org])
AC_CONFIG_SRCDIR([src/ls.c])
@ -47,7 +47,7 @@ coreutils_MACROS
AC_ARG_ENABLE([gcc-warnings],
[AS_HELP_STRING([--enable-gcc-warnings],
[turn on lots of GCC warnings (for developers)])],
[turn on lots of GCC warnings (for developers)])],
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
@ -122,11 +122,11 @@ AC_FUNC_FORK
optional_bin_progs=
AC_CHECK_FUNCS([uname],
gl_ADD_PROG([optional_bin_progs], [uname]))
gl_ADD_PROG([optional_bin_progs], [uname]))
AC_CHECK_FUNCS([chroot],
gl_ADD_PROG([optional_bin_progs], [chroot]))
gl_ADD_PROG([optional_bin_progs], [chroot]))
AC_CHECK_FUNCS([gethostid],
gl_ADD_PROG([optional_bin_progs], [hostid]))
gl_ADD_PROG([optional_bin_progs], [hostid]))
gl_WINSIZE_IN_PTEM
@ -168,9 +168,9 @@ int main()
[# If we have tzset, assume the worst when cross-compiling.
utils_cv_localtime_cache=yes])
else
# If we lack tzset, report that localtime does not cache TZ,
# since we can't invalidate the cache if we don't have tzset.
utils_cv_localtime_cache=no
# If we lack tzset, report that localtime does not cache TZ,
# since we can't invalidate the cache if we don't have tzset.
utils_cv_localtime_cache=no
fi])dnl
AC_MSG_RESULT([$utils_cv_localtime_cache])
if test $utils_cv_localtime_cache = yes; then
@ -197,7 +197,7 @@ AC_CACHE_CHECK([for 3-argument setpriority function],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/time.h>
#include <sys/resource.h>
#include <sys/resource.h>
]],
[[setpriority (0, 0, 0);]])],
[utils_cv_func_setpriority=yes],
@ -374,8 +374,8 @@ case $t in
$no_install_progs_default) ;;
*) AC_MSG_ERROR([[internal error: g'l_INCLUDE_EXCLUDE_PROG's 2nd arg, $t,
does not match the list of default-not-installed programs
($no_install_progs_default) also recorded in $mk]],
1) ;;
($no_install_progs_default) also recorded in $mk]],
1) ;;
esac
# Given the name of a variable containing a space-separated list of

View File

@ -71,22 +71,23 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
$(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/cycle-check.m4 \
$(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \
$(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
$(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \
$(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
$(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
$(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
$(top_srcdir)/m4/euidaccess-stat.m4 \
$(top_srcdir)/m4/dirent-safer.m4 $(top_srcdir)/m4/dirent_h.m4 \
$(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
$(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \
$(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
$(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \
$(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/euidaccess-stat.m4 \
$(top_srcdir)/m4/euidaccess.m4 $(top_srcdir)/m4/exclude.m4 \
$(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/exponentd.m4 \
$(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \
$(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \
$(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-safer.m4 \
$(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fd-reopen.m4 \
$(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/file-type.m4 \
$(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/filemode.m4 \
$(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \
$(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \
$(top_srcdir)/m4/fdopendir.m4 $(top_srcdir)/m4/fflush.m4 \
$(top_srcdir)/m4/file-type.m4 $(top_srcdir)/m4/fileblocks.m4 \
$(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/filenamecat.m4 \
$(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
$(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fopen.m4 \
$(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \
$(top_srcdir)/m4/fprintftime.m4 $(top_srcdir)/m4/fpurge.m4 \
$(top_srcdir)/m4/freading.m4 $(top_srcdir)/m4/frexp.m4 \
@ -128,37 +129,38 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/lib-check.m4 $(top_srcdir)/m4/lib-ignore.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/link-follow.m4 \
$(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
$(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
$(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/long-options.m4 \
$(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ls-mntd-fs.m4 \
$(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
$(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
$(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \
$(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
$(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \
$(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \
$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbswidth.m4 \
$(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memcasecmp.m4 \
$(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \
$(top_srcdir)/m4/memcoll.m4 $(top_srcdir)/m4/memcpy.m4 \
$(top_srcdir)/m4/memmove.m4 $(top_srcdir)/m4/mempcpy.m4 \
$(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/memset.m4 \
$(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mgetgroups.m4 \
$(top_srcdir)/m4/mkancesdirs.m4 $(top_srcdir)/m4/mkdir-p.m4 \
$(top_srcdir)/m4/mkdir-slash.m4 $(top_srcdir)/m4/mkstemp.m4 \
$(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \
$(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/modechange.m4 \
$(top_srcdir)/m4/mountlist.m4 $(top_srcdir)/m4/mpsort.m4 \
$(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nanosleep.m4 \
$(top_srcdir)/m4/netdb_h.m4 $(top_srcdir)/m4/netinet_in_h.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \
$(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \
$(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perl.m4 \
$(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/physmem.m4 \
$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix-shell.m4 \
$(top_srcdir)/m4/posixtm.m4 $(top_srcdir)/m4/posixver.m4 \
$(top_srcdir)/m4/prereq.m4 $(top_srcdir)/m4/printf-frexp.m4 \
$(top_srcdir)/m4/link.m4 $(top_srcdir)/m4/localcharset.m4 \
$(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \
$(top_srcdir)/m4/locale-tr.m4 $(top_srcdir)/m4/locale-zh.m4 \
$(top_srcdir)/m4/long-options.m4 $(top_srcdir)/m4/longlong.m4 \
$(top_srcdir)/m4/ls-mntd-fs.m4 $(top_srcdir)/m4/lseek.m4 \
$(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \
$(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/manywarnings.m4 \
$(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbchar.m4 \
$(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrlen.m4 \
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
$(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \
$(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/md5.m4 \
$(top_srcdir)/m4/memcasecmp.m4 $(top_srcdir)/m4/memchr.m4 \
$(top_srcdir)/m4/memcmp.m4 $(top_srcdir)/m4/memcoll.m4 \
$(top_srcdir)/m4/memcpy.m4 $(top_srcdir)/m4/memmove.m4 \
$(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
$(top_srcdir)/m4/memset.m4 $(top_srcdir)/m4/memxfrm.m4 \
$(top_srcdir)/m4/mgetgroups.m4 $(top_srcdir)/m4/mkancesdirs.m4 \
$(top_srcdir)/m4/mkdir-p.m4 $(top_srcdir)/m4/mkdir-slash.m4 \
$(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mktime.m4 \
$(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
$(top_srcdir)/m4/modechange.m4 $(top_srcdir)/m4/mountlist.m4 \
$(top_srcdir)/m4/mpsort.m4 $(top_srcdir)/m4/multiarch.m4 \
$(top_srcdir)/m4/nanosleep.m4 $(top_srcdir)/m4/netdb_h.m4 \
$(top_srcdir)/m4/netinet_in_h.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/open.m4 \
$(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \
$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/perror.m4 \
$(top_srcdir)/m4/physmem.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/posix-shell.m4 $(top_srcdir)/m4/posixtm.m4 \
$(top_srcdir)/m4/posixver.m4 $(top_srcdir)/m4/prereq.m4 \
$(top_srcdir)/m4/printf-frexp.m4 \
$(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \
$(top_srcdir)/m4/priv-set.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \
@ -330,6 +332,7 @@ GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GNULIB_ACCEPT = @GNULIB_ACCEPT@
GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
GNULIB_ATOLL = @GNULIB_ATOLL@
GNULIB_BIND = @GNULIB_BIND@
@ -343,10 +346,15 @@ GNULIB_CONNECT = @GNULIB_CONNECT@
GNULIB_DIRFD = @GNULIB_DIRFD@
GNULIB_DPRINTF = @GNULIB_DPRINTF@
GNULIB_DUP2 = @GNULIB_DUP2@
GNULIB_DUP3 = @GNULIB_DUP3@
GNULIB_ENVIRON = @GNULIB_ENVIRON@
GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
GNULIB_FCHDIR = @GNULIB_FCHDIR@
GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
GNULIB_FCLOSE = @GNULIB_FCLOSE@
GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
GNULIB_FFLUSH = @GNULIB_FFLUSH@
GNULIB_FLOORF = @GNULIB_FLOORF@
GNULIB_FLOORL = @GNULIB_FLOORL@
@ -361,6 +369,7 @@ GNULIB_FREXP = @GNULIB_FREXP@
GNULIB_FREXPL = @GNULIB_FREXPL@
GNULIB_FSEEK = @GNULIB_FSEEK@
GNULIB_FSEEKO = @GNULIB_FSEEKO@
GNULIB_FSTATAT = @GNULIB_FSTATAT@
GNULIB_FSYNC = @GNULIB_FSYNC@
GNULIB_FTELL = @GNULIB_FTELL@
GNULIB_FTELLO = @GNULIB_FTELLO@
@ -424,12 +433,19 @@ GNULIB_MEMCHR = @GNULIB_MEMCHR@
GNULIB_MEMMEM = @GNULIB_MEMMEM@
GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
GNULIB_MKNODAT = @GNULIB_MKNODAT@
GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
GNULIB_OPEN = @GNULIB_OPEN@
GNULIB_OPENAT = @GNULIB_OPENAT@
GNULIB_PERROR = @GNULIB_PERROR@
GNULIB_PIPE2 = @GNULIB_PIPE2@
GNULIB_POPEN = @GNULIB_POPEN@
GNULIB_PRINTF = @GNULIB_PRINTF@
GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
GNULIB_PUTC = @GNULIB_PUTC@
@ -439,9 +455,11 @@ GNULIB_PUTS = @GNULIB_PUTS@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
GNULIB_READLINKAT = @GNULIB_READLINKAT@
GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
GNULIB_RECV = @GNULIB_RECV@
GNULIB_RECVFROM = @GNULIB_RECVFROM@
GNULIB_RENAME = @GNULIB_RENAME@
GNULIB_ROUND = @GNULIB_ROUND@
GNULIB_ROUNDF = @GNULIB_ROUNDF@
GNULIB_ROUNDL = @GNULIB_ROUNDL@
@ -481,11 +499,13 @@ GNULIB_STRTOLL = @GNULIB_STRTOLL@
GNULIB_STRTOULL = @GNULIB_STRTOULL@
GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
GNULIB_TRUNC = @GNULIB_TRUNC@
GNULIB_TRUNCF = @GNULIB_TRUNCF@
GNULIB_TRUNCL = @GNULIB_TRUNCL@
GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
GNULIB_UNSETENV = @GNULIB_UNSETENV@
GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
@ -502,6 +522,7 @@ GNULIB_WCTOB = @GNULIB_WCTOB@
GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
GNULIB_WRITE = @GNULIB_WRITE@
GREP = @GREP@
HAVE_ACCEPT4 = @HAVE_ACCEPT4@
HAVE_ALPHASORT = @HAVE_ALPHASORT@
HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
HAVE_ATOLL = @HAVE_ATOLL@
@ -552,8 +573,14 @@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
HAVE_DPRINTF = @HAVE_DPRINTF@
HAVE_DUP2 = @HAVE_DUP2@
HAVE_DUP3 = @HAVE_DUP3@
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
HAVE_FACCESSAT = @HAVE_FACCESSAT@
HAVE_FCHMODAT = @HAVE_FCHMODAT@
HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
HAVE_FSEEKO = @HAVE_FSEEKO@
HAVE_FSTATAT = @HAVE_FSTATAT@
HAVE_FSYNC = @HAVE_FSYNC@
HAVE_FTELLO = @HAVE_FTELLO@
HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
@ -579,15 +606,22 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
HAVE_MEMPCPY = @HAVE_MEMPCPY@
HAVE_MKDIRAT = @HAVE_MKDIRAT@
HAVE_MKDTEMP = @HAVE_MKDTEMP@
HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
HAVE_MKNODAT = @HAVE_MKNODAT@
HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
HAVE_NETDB_H = @HAVE_NETDB_H@
HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
HAVE_PIPE2 = @HAVE_PIPE2@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
HAVE_READLINK = @HAVE_READLINK@
HAVE_READLINKAT = @HAVE_READLINKAT@
HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
HAVE_RPMATCH = @HAVE_RPMATCH@
HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
@ -605,7 +639,6 @@ HAVE_STPCPY = @HAVE_STPCPY@
HAVE_STPNCPY = @HAVE_STPNCPY@
HAVE_STRCASESTR = @HAVE_STRCASESTR@
HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
HAVE_STRNDUP = @HAVE_STRNDUP@
HAVE_STRPBRK = @HAVE_STRPBRK@
HAVE_STRSEP = @HAVE_STRSEP@
HAVE_STRTOD = @HAVE_STRTOD@
@ -617,6 +650,8 @@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
HAVE_SYMLINK = @HAVE_SYMLINK@
HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
@ -628,6 +663,7 @@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
HAVE_UNISTD_H = @HAVE_UNISTD_H@
HAVE_UNLINKAT = @HAVE_UNLINKAT@
HAVE_UNSETENV = @HAVE_UNSETENV@
HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
HAVE_VASPRINTF = @HAVE_VASPRINTF@
@ -780,6 +816,7 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
REPLACE_DPRINTF = @REPLACE_DPRINTF@
REPLACE_DUP2 = @REPLACE_DUP2@
REPLACE_FCHDIR = @REPLACE_FCHDIR@
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
REPLACE_FCLOSE = @REPLACE_FCLOSE@
REPLACE_FFLUSH = @REPLACE_FFLUSH@
REPLACE_FLOORF = @REPLACE_FLOORF@
@ -792,6 +829,7 @@ REPLACE_FREXP = @REPLACE_FREXP@
REPLACE_FREXPL = @REPLACE_FREXPL@
REPLACE_FSEEK = @REPLACE_FSEEK@
REPLACE_FSEEKO = @REPLACE_FSEEKO@
REPLACE_FSTATAT = @REPLACE_FSTATAT@
REPLACE_FTELL = @REPLACE_FTELL@
REPLACE_FTELLO = @REPLACE_FTELLO@
REPLACE_GETCWD = @REPLACE_GETCWD@
@ -808,6 +846,7 @@ REPLACE_ISNAN = @REPLACE_ISNAN@
REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
REPLACE_LCHOWN = @REPLACE_LCHOWN@
REPLACE_LDEXPL = @REPLACE_LDEXPL@
REPLACE_LINK = @REPLACE_LINK@
REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
REPLACE_LSEEK = @REPLACE_LSEEK@
REPLACE_LSTAT = @REPLACE_LSTAT@
@ -828,8 +867,10 @@ REPLACE_NULL = @REPLACE_NULL@
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
REPLACE_OPEN = @REPLACE_OPEN@
REPLACE_PERROR = @REPLACE_PERROR@
REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
REPLACE_RENAME = @REPLACE_RENAME@
REPLACE_ROUND = @REPLACE_ROUND@
REPLACE_ROUNDF = @REPLACE_ROUNDF@
REPLACE_ROUNDL = @REPLACE_ROUNDL@
@ -842,10 +883,12 @@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
REPLACE_STRPTIME = @REPLACE_STRPTIME@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TRUNCL = @REPLACE_TRUNCL@
REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
@ -878,13 +921,13 @@ SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
SYS_SELECT_H = @SYS_SELECT_H@
SYS_SOCKET_H = @SYS_SOCKET_H@
SYS_STAT_H = @SYS_STAT_H@
SYS_TIME_H = @SYS_TIME_H@
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
U = @U@
UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
USE_ACL = @USE_ACL@

File diff suppressed because it is too large Load Diff

View File

@ -618,15 +618,8 @@ from the shell.
@end macro
@macro multiplierSuffixes{varName}
@ignore
Appending @samp{b} multiplies @var{\varName\} by 512,
@samp{kB} by 1000, @samp{K} by 1024,
@samp{MB} by 1000*1000, @samp{M} by 1024*1024,
@samp{GB} by 1000*1000*1000, @samp{G} by 1024*1024*1024,
and so on for @samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}.
@end ignore
@var{\varName\} is a number which may have one of the following
multiplicative suffixes:
@var{\varName\} may be, or may be an integer optionally followed by,
one of the following multiplicative suffixes:
@example
@samp{b} => 512 ("blocks")
@samp{KB} => 1000 (KiloBytes)
@ -641,8 +634,8 @@ and so on for @samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}.
@c FIXME: same as above, but no ``blocks'' line.
@macro multiplierSuffixesNoBlocks{varName}
@var{\varName\} is a number which may have one of the following
multiplicative suffixes:
@var{\varName\} may be, or may be an integer optionally followed by,
one of the following multiplicative suffixes:
@example
@samp{KB} => 1000 (KiloBytes)
@samp{K} => 1024 (KibiBytes)
@ -2122,14 +2115,6 @@ The program accepts the following options. Also see @ref{Common options}.
@table @samp
@item -C
@itemx --compare
@opindex -C
@opindex --compare
Compare each pair of source and destination files, and if the destination has
identical content and any specified owner, group, permissions, and possibly
SELinux context, then do not modify the destination at all.
@item -c
@itemx --crown-margin
@opindex -c
@ -2790,9 +2775,10 @@ growing.
The option values @samp{descriptor} and @samp{name} may be specified only
with the long form of the option, not with @option{-f}.
@vindex POSIXLY_CORRECT
If @env{POSIXLY_CORRECT} is set, the @option{-f} option is ignored if
The @option{-f} option is ignored if
no @var{file} operand is specified and standard input is a FIFO or a pipe.
Likewise, the @option{-f} option has no effect for any
operand specified as @samp{-}, when standard input is a FIFO or a pipe.
@item -F
@opindex -F
@ -7445,12 +7431,10 @@ may preserve the group ownership of a file only if they happen to be
a member of the desired group.
@itemx timestamps
Preserve the times of last access and last modification, when possible.
In general, it is not possible to preserve these attributes
On older systems, it is not possible to preserve these attributes
when the affected file is a symbolic link.
However, FreeBSD now provides the @code{lutimes} function, which makes
it possible even for symbolic links. However, this implementation does
not yet take advantage of that.
@c FIXME: once we provide lutimes support, update the above.
However, many systems now provide the @code{utimensat} function,
which makes it possible even for symbolic links.
@itemx links
Preserve in the destination files
any links between corresponding source files.
@ -7543,15 +7527,31 @@ Also, it is not portable to use @option{-R} to copy symbolic links
unless you also specify @option{-P}, as @acronym{POSIX} allows
implementations that dereference symbolic links by default.
@item --reflink
@opindex --reflink
@item --reflink[=@var{when}]
@opindex --reflink[=@var{when}]
@cindex COW
@cindex clone
@cindex copy on write
Perform a lightweight, copy-on-write (COW) copy.
Copying with this option can succeed only on some relatively new file systems.
Copying with this option can succeed only on some file systems.
Once it has succeeded, beware that the source and destination files
share the same disk data blocks as long as they remain unmodified.
Thus, if a disk I/O error affects data blocks of one of the files,
the other suffers the exact same fate.
The @var{when} value can be one of the following:
@table @samp
@item always
The default behavior: if the copy-on-write operation is not supported
then report the failure for each file and exit with a failure status.
@item auto
If the copy-on-write operation is not supported then fall back
to the standard copy behaviour.
@end table
@item --remove-destination
@opindex --remove-destination
Remove each existing destination file before attempting to open it
@ -7768,8 +7768,8 @@ input newline with a space and padding with spaces as necessary.
@item unblock
@opindex unblock
Replace trailing spaces in each @samp{cbs}-sized input block with a
newline.
Remove any trailing spaces in each @samp{cbs}-sized input block,
and append a newline.
The @samp{block} and @samp{unblock} conversions are mutually exclusive.
@ -8058,6 +8058,14 @@ The program accepts the following options. Also see @ref{Common options}.
@optBackup
@item -C
@itemx --compare
@opindex -C
@opindex --compare
Compare each pair of source and destination files, and if the destination has
identical content and any specified owner, group, permissions, and possibly
SELinux context, then do not modify the destination at all.
@item -c
@opindex -c
Ignored; for compatibility with old Unix versions of @command{install}.

View File

@ -1,4 +1,4 @@
@set UPDATED 18 August 2009
@set UPDATED-MONTH August 2009
@set EDITION 7.5
@set VERSION 7.5
@set UPDATED 10 September 2009
@set UPDATED-MONTH September 2009
@set EDITION 7.6
@set VERSION 7.6

View File

@ -1,4 +1,4 @@
@set UPDATED 18 August 2009
@set UPDATED-MONTH August 2009
@set EDITION 7.5
@set VERSION 7.5
@set UPDATED 10 September 2009
@set UPDATED-MONTH September 2009
@set EDITION 7.6
@set VERSION 7.6

View File

@ -4,7 +4,7 @@ SubDir HAIKU_TOP src bin coreutils lib ;
TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS)
: -Wall -Wmissing-prototypes -Wsign-compare ] ;
SubDirCcFlags -DHAVE_CONFIG_H ;
SubDirCcFlags -DHAVE_CONFIG_H -DB_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT ;
SubDirSysHdrs $(SUBDIR) ;
#SubDirSysHdrs $(SUBDIR) $(DOTDOT) ;
@ -139,6 +139,7 @@ StaticLibrary libfetish.a :
openat-die.c
openat-proc.c
openat.c
opendir-safer.c
physmem.c
posixtm.c
posixver.c

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* Define an at-style functions like fstatat, unlinkat, fchownat, etc.
Copyright (C) 2006 Free Software Foundation, Inc.
Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -16,35 +16,58 @@
/* written by Jim Meyering */
#define CALL_FUNC(F) \
(AT_FUNC_USE_F1_COND \
#ifdef AT_FUNC_USE_F1_COND
# define CALL_FUNC(F) \
(flag == AT_FUNC_USE_F1_COND \
? AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS) \
: AT_FUNC_F2 (F AT_FUNC_POST_FILE_ARGS))
# define VALIDATE_FLAG(F) \
if (flag & ~AT_FUNC_USE_F1_COND) \
{ \
errno = EINVAL; \
return -1; \
}
#else
# define CALL_FUNC(F) (AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS))
# define VALIDATE_FLAG(F) /* empty */
#endif
/* Call AT_FUNC_F1 or AT_FUNC_F2 (testing AT_FUNC_USE_F1_COND to
determine which) to operate on FILE, which is in the directory
open on descriptor FD. If possible, do it without changing the
#ifdef AT_FUNC_RESULT
# define FUNC_RESULT AT_FUNC_RESULT
#else
# define FUNC_RESULT int
#endif
/* Call AT_FUNC_F1 to operate on FILE, which is in the directory
open on descriptor FD. If AT_FUNC_USE_F1_COND is defined to a value,
AT_FUNC_POST_FILE_PARAM_DECLS must inlude a parameter named flag;
call AT_FUNC_F2 if FLAG is 0 or fail if FLAG contains more bits than
AT_FUNC_USE_F1_COND. If possible, do it without changing the
working directory. Otherwise, resort to using save_cwd/fchdir,
then AT_FUNC_F?/restore_cwd. If either the save_cwd or the restore_cwd
fails, then give a diagnostic and exit nonzero. */
int
FUNC_RESULT
AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
{
/* Be careful to choose names unlikely to conflict with
AT_FUNC_POST_FILE_PARAM_DECLS. */
struct saved_cwd saved_cwd;
int saved_errno;
int err;
FUNC_RESULT err;
VALIDATE_FLAG (flag);
if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
return CALL_FUNC (file);
{
char buf[OPENAT_BUFFER_SIZE];
char *proc_file = openat_proc_name (buf, fd, file);
char proc_buf[OPENAT_BUFFER_SIZE];
char *proc_file = openat_proc_name (proc_buf, fd, file);
if (proc_file)
{
int proc_result = CALL_FUNC (proc_file);
FUNC_RESULT proc_result = CALL_FUNC (proc_file);
int proc_errno = errno;
if (proc_file != buf)
if (proc_file != proc_buf)
free (proc_file);
/* If the syscall succeeds, or if it fails with an unexpected
errno value, then return right away. Otherwise, fall through
@ -83,3 +106,4 @@ AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
return err;
}
#undef CALL_FUNC
#undef FUNC_RESULT

View File

@ -1,7 +1,7 @@
/* backupfile.c -- make Emacs style backup file names
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
@ -37,7 +37,7 @@
#include <unistd.h>
#include <dirent.h>
#include "dirent--.h"
#ifndef _D_EXACT_NAMLEN
# define _D_EXACT_NAMLEN(dp) strlen ((dp)->d_name)
#endif
@ -80,11 +80,6 @@
of `digit' even when the host does not conform to POSIX. */
#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
/* The results of opendir() in this file are not used with dirfd and fchdir,
therefore save some unnecessary work in fchdir.c. */
#undef opendir
#undef closedir
/* The extension added to file names to produce a simple (as opposed
to numbered) backup file name. */
char const *simple_backup_suffix = "~";

View File

@ -34,22 +34,22 @@ buffer_lcm (size_t a, size_t b, size_t lcm_max)
else
{
if (b)
{
/* Return lcm (A, B) if it is in range; otherwise, fall back
on A. */
{
/* Return lcm (A, B) if it is in range; otherwise, fall back
on A. */
size_t lcm, m, n, q, r;
size_t lcm, m, n, q, r;
/* N = gcd (A, B). */
for (m = a, n = b; (r = m % n) != 0; m = n, n = r)
continue;
/* N = gcd (A, B). */
for (m = a, n = b; (r = m % n) != 0; m = n, n = r)
continue;
/* LCM = lcm (A, B), if in range. */
q = a / n;
lcm = q * b;
if (lcm <= lcm_max && lcm / b == q)
return lcm;
}
/* LCM = lcm (A, B), if in range. */
q = a / n;
lcm = q * b;
if (lcm <= lcm_max && lcm / b == q)
return lcm;
}
size = a;
}

View File

@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file.
Copyright (C) 1996-2008 Free Software Foundation, Inc.
Copyright (C) 1996-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -38,9 +38,6 @@
#include "xalloc.h"
#include "xgetcwd.h"
#ifndef ELOOP
# define ELOOP 0
#endif
#ifndef __set_errno
# define __set_errno(Val) errno = (Val)
#endif
@ -199,7 +196,7 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
dest = rname + 1;
}
for (start = end = name; *start; start = end)
for (start = name; *start; start = end)
{
/* Skip sequence of multiple file name separators. */
while (*start == '/')

View File

@ -1,5 +1,5 @@
/* provide a chdir function that tries not to fail due to ENAMETOOLONG
Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2004-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,7 +20,6 @@
#include "chdir-long.h"
#include <fcntl.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
@ -28,7 +27,7 @@
#include <stdio.h>
#include <assert.h>
#include "openat.h"
#include "fcntl--.h"
#ifndef PATH_MAX
# error "compile this file only if your system defines PATH_MAX"

View File

@ -1,7 +1,7 @@
/* provide consistent interface to chown for systems that don't interpret
an ID of -1 as meaning `don't change the corresponding ID'.
Copyright (C) 1997, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1997, 2004-2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -46,7 +46,8 @@
int
rpl_chown (const char *file, uid_t uid, gid_t gid)
{
#if CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE
#if HAVE_CHOWN
# if CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE
if (gid == (gid_t) -1 || uid == (uid_t) -1)
{
struct stat file_stats;
@ -61,9 +62,9 @@ rpl_chown (const char *file, uid_t uid, gid_t gid)
if (uid == (uid_t) -1)
uid = file_stats.st_uid;
}
#endif
# endif
#if CHOWN_MODIFIES_SYMLINK
# if CHOWN_MODIFIES_SYMLINK
{
/* Handle the case in which the system-supplied chown function
does *not* follow symlinks. Instead, it changes permissions
@ -97,7 +98,12 @@ rpl_chown (const char *file, uid_t uid, gid_t gid)
else if (errno != EACCES)
return -1;
}
#endif
# endif
return chown (file, uid, gid);
#else /* !HAVE_CHOWN */
errno = ENOSYS;
return -1;
#endif
}

View File

@ -24,10 +24,6 @@
#include <unistd.h>
#include <fcntl.h>
#ifndef FD_CLOEXEC
# define FD_CLOEXEC 1
#endif
/* Set the `FD_CLOEXEC' flag of DESC if VALUE is true,
or clear the flag if VALUE is false.
Return 0 on success, or -1 on error with `errno' set. */

View File

@ -33,7 +33,7 @@ rpl_close (int fd)
int retval = close (fd);
#endif
#ifdef FCHDIR_REPLACEMENT
#if REPLACE_FCHDIR
if (retval >= 0)
_gl_unregister_fd (fd);
#endif

View File

@ -1747,7 +1747,7 @@
/* #undef LDBL_SIGNBIT_WORD */
/* Define if `link(2)' dereferences symbolic links. */
/* #undef LINK_FOLLOWS_SYMLINKS */
#define LINK_FOLLOWS_SYMLINKS -1
/* FIXME */
/* #undef LOCALTIME_CACHE */

View File

@ -97,9 +97,6 @@
language is requested. */
#undef ENABLE_NLS
/* Define if gnulib's fchdir() replacement is used. */
#undef FCHDIR_REPLACEMENT
/* Define on systems for which file names may have a so-called `drive letter'
prefix, define this to compute the length of that prefix, including the
colon. */
@ -135,6 +132,9 @@
/* Define as the word index where to find the sign of 'float'. */
#undef FLT_SIGNBIT_WORD
/* Define to 1 if fopen() fails to recognize a trailing slash. */
#undef FOPEN_TRAILING_SLASH_BUG
/* Define to 1 if ungetc is broken when used on arbitrary bytes. */
#undef FUNC_UNGETC_BROKEN
@ -158,6 +158,9 @@
/* Define to 1 when using the gnulib module close-stream. */
#undef GNULIB_CLOSE_STREAM
/* Define to 1 when using the gnulib module dirent-safer. */
#undef GNULIB_DIRENT_SAFER
/* Define to 1 when using the gnulib module fcntl-safer. */
#undef GNULIB_FCNTL_SAFER
@ -179,12 +182,21 @@
/* Define to 1 when using the gnulib module open. */
#undef GNULIB_OPEN
/* Define to 1 when using the gnulib module openat-safer. */
#undef GNULIB_OPENAT_SAFER
/* enable some gnulib portability checks */
#undef GNULIB_PORTCHECK
/* Define to indicate the 'realloc' module. */
#undef GNULIB_REALLOC_GNU
/* Define to 1 when using the gnulib module stdlib-safer. */
#undef GNULIB_STDLIB_SAFER
/* Define to 1 when using the gnulib module unistd-safer. */
#undef GNULIB_UNISTD_SAFER
/* Define to 1 when using the gnulib module unistr/u8-uctomb. */
#undef GNULIB_UNISTR_U8_UCTOMB
@ -322,7 +334,7 @@
the CoreFoundation framework. */
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
/* Define to 1 if your system has a working `chown' function. */
/* Define to 1 if you have the `chown' function. */
#undef HAVE_CHOWN
/* Define to 1 if you have the `chroot' function. */
@ -547,6 +559,10 @@
don't. */
#undef HAVE_DECL_MEMRCHR
/* Define to 1 if you have the declaration of `program_invocation_name', and
to 0 if you don't. */
#undef HAVE_DECL_PROGRAM_INVOCATION_NAME
/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_PUTCHAR_UNLOCKED
@ -688,6 +704,9 @@
/* Define to 1 if you have the `euidaccess' function. */
#undef HAVE_EUIDACCESS
/* Define to 1 if you have the `faccessat' function. */
#undef HAVE_FACCESSAT
/* Define to 1 if you have the `fchdir' function. */
#undef HAVE_FCHDIR
@ -941,6 +960,9 @@
/* Define to 1 if you have the `ypsec' library (-lypsec). */
#undef HAVE_LIBYPSEC
/* Define to 1 if you have the `link' function. */
#undef HAVE_LINK
/* Define to 1 if you have the `listmntent' function. */
#undef HAVE_LISTMNTENT
@ -1253,7 +1275,7 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the strndup() function and it works. */
/* Define to 1 if you have the `strndup' function. */
#undef HAVE_STRNDUP
/* Define to 1 if you have the `strnlen' function. */
@ -1439,6 +1461,9 @@
/* Define if struct stat has an st_dm_mode member. */
#undef HAVE_ST_DM_MODE
/* Define to 1 if you have the `symlink' function. */
#undef HAVE_SYMLINK
/* Define to 1 if you have the `sync' function. */
#undef HAVE_SYNC
@ -1745,7 +1770,8 @@
/* Define as the word index where to find the sign of 'long double'. */
#undef LDBL_SIGNBIT_WORD
/* Define if `link(2)' dereferences symbolic links. */
/* Define to 1 if `link(2)' dereferences symbolic links, 0 if it creates hard
links to symlinks, and -1 if unknown. */
#undef LINK_FOLLOWS_SYMLINKS
/* FIXME */
@ -1962,6 +1988,13 @@
/* Define to 1 if dup2 returns 0 instead of the target fd. */
#undef REPLACE_DUP2
/* Define to 1 if gnulib's fchdir() replacement is used. */
#undef REPLACE_FCHDIR
/* Define to 1 if open() should work around the inability to open a directory.
*/
#undef REPLACE_OPEN_DIRECTORY
/* Define this to 1 if strerror is broken. */
#undef REPLACE_STRERROR
@ -2170,9 +2203,6 @@
used. */
#undef __GETOPT_PREFIX
/* Define to rpl_ if the openat replacement function should be used. */
#undef __OPENAT_PREFIX
/* Define like PROTOTYPES; this can be used by system headers. */
#undef __PROTOTYPES
@ -2186,9 +2216,6 @@
/* Define to rpl_calloc if the replacement function should be used. */
#undef calloc
/* Define to rpl_fchownat if the replacement function should be used. */
#undef fchownat
/* Define to a replacement function name for fnmatch(). */
#undef fnmatch

View File

@ -0,0 +1,23 @@
/* Like dirent.h, but redefine some names to avoid glitches.
Copyright (C) 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Eric Blake. */
#include "dirent-safer.h"
#undef opendir
#define opendir opendir_safer

View File

@ -0,0 +1,22 @@
/* Invoke dirent-like functions, but avoid some glitches.
Copyright (C) 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Eric Blake. */
#include <dirent.h>
DIR *opendir_safer (const char *name);

View File

@ -58,6 +58,23 @@ extern int dirfd (DIR const *dir);
dirfd (d))
#endif
#if @GNULIB_FDOPENDIR@
# if !@HAVE_FDOPENDIR@
/* Open a directory stream visiting the given directory file
descriptor. Return NULL and set errno if fd is not visiting a
directory. On success, this function consumes fd (it will be
implicitly closed either by this function or by a subsequent
closedir). */
extern DIR *fdopendir (int fd);
# endif
#elif defined GNULIB_POSIXCHECK
# undef fdopendir
# define fdopendir(f) \
(GL_LINK_WARNING ("fdopendir is unportable - " \
"use gnulib module fdopendir for portability"), \
fdopendir (f))
#endif
#if @GNULIB_SCANDIR@
/* Scan the directory DIR, calling FILTER on each directory entry.
Entries for which FILTER returns nonzero are individually malloc'd,

View File

@ -32,7 +32,7 @@
int
dup_safer (int fd)
{
#if defined F_DUPFD && !defined FCHDIR_REPLACEMENT
#if defined F_DUPFD && !REPLACE_FCHDIR
return fcntl (fd, F_DUPFD, STDERR_FILENO + 1);
#else
/* fd_safer calls us back, but eventually the recursion unwinds and

View File

@ -55,8 +55,25 @@ rpl_dup2 (int fd, int desired_fd)
}
# endif
result = dup2 (fd, desired_fd);
# ifdef __linux__
/* Correct a Linux return value.
<http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.30.y.git;a=commitdiff;h=2b79bc4f7ebbd5af3c8b867968f9f15602d5f802>
*/
if (fd == desired_fd && result == (unsigned int) -EBADF)
{
errno = EBADF;
result = -1;
}
# endif
if (result == 0)
result = desired_fd;
/* Correct a cygwin 1.5.x errno value. */
else if (result == -1 && errno == EMFILE)
errno = EBADF;
#if REPLACE_FCHDIR
if (fd != desired_fd && result == desired_fd)
result = _gl_register_dup (fd, desired_fd);
#endif
return result;
}
@ -85,13 +102,19 @@ dupfd (int fd, int desired_fd)
int
dup2 (int fd, int desired_fd)
{
int result;
if (fd == desired_fd)
return fd;
return fcntl (fd, F_GETFL) < 0 ? -1 : fd;
close (desired_fd);
# ifdef F_DUPFD
return fcntl (fd, F_DUPFD, desired_fd);
result = fcntl (fd, F_DUPFD, desired_fd);
# else
return dupfd (fd, desired_fd);
result = dupfd (fd, desired_fd);
# endif
#if REPLACE_FCHDIR
if (0 <= result)
result = _gl_register_dup (fd, desired_fd);
#endif
return result;
}
#endif /* !REPLACE_DUP2 */

View File

@ -57,8 +57,8 @@ euidaccess_stat (struct stat const *st, int mode)
mode &= 7;
else
mode = ((mode & R_OK ? 4 : 0)
+ (mode & W_OK ? 2 : 0)
+ (mode & X_OK ? 1 : 0));
+ (mode & W_OK ? 2 : 0)
+ (mode & X_OK ? 1 : 0));
if (mode == 0)
return true; /* The file exists. */
@ -68,7 +68,7 @@ euidaccess_stat (struct stat const *st, int mode)
/* The super-user can read and write any file, and execute any file
that anyone can execute. */
if (euid == 0 && ((mode & X_OK) == 0
|| (st->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
|| (st->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
return true;
/* Convert the file's permission bits to traditional form. */
@ -84,14 +84,14 @@ euidaccess_stat (struct stat const *st, int mode)
granted = st->st_mode;
else
granted = ( (st->st_mode & S_IRUSR ? 4 << 6 : 0)
+ (st->st_mode & S_IWUSR ? 2 << 6 : 0)
+ (st->st_mode & S_IXUSR ? 1 << 6 : 0)
+ (st->st_mode & S_IRGRP ? 4 << 3 : 0)
+ (st->st_mode & S_IWGRP ? 2 << 3 : 0)
+ (st->st_mode & S_IXGRP ? 1 << 3 : 0)
+ (st->st_mode & S_IROTH ? 4 << 0 : 0)
+ (st->st_mode & S_IWOTH ? 2 << 0 : 0)
+ (st->st_mode & S_IXOTH ? 1 << 0 : 0));
+ (st->st_mode & S_IWUSR ? 2 << 6 : 0)
+ (st->st_mode & S_IXUSR ? 1 << 6 : 0)
+ (st->st_mode & S_IRGRP ? 4 << 3 : 0)
+ (st->st_mode & S_IWGRP ? 2 << 3 : 0)
+ (st->st_mode & S_IXGRP ? 1 << 3 : 0)
+ (st->st_mode & S_IROTH ? 4 << 0 : 0)
+ (st->st_mode & S_IWOTH ? 2 << 0 : 0)
+ (st->st_mode & S_IXOTH ? 1 << 0 : 0));
if (euid == st->st_uid)
granted >>= 6;
@ -99,7 +99,7 @@ euidaccess_stat (struct stat const *st, int mode)
{
gid_t egid = getegid ();
if (egid == st->st_gid || group_member (st->st_gid))
granted >>= 3;
granted >>= 3;
}
if ((mode & ~granted) == 0)

View File

@ -1,7 +1,7 @@
/* euidaccess -- check if effective user id can access file
Copyright (C) 1990, 1991, 1995, 1998, 2000, 2003, 2004, 2005, 2006, 2008
Free Software Foundation, Inc.
Copyright (C) 1990, 1991, 1995, 1998, 2000, 2003, 2004, 2005, 2006,
2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@ -25,6 +25,7 @@
# include <config.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@ -77,7 +78,9 @@
int
euidaccess (const char *file, int mode)
{
#if defined EFF_ONLY_OK
#if HAVE_FACCESSAT
return faccessat (AT_FDCWD, file, mode, AT_EACCESS);
#elif defined EFF_ONLY_OK
return access (file, mode | EFF_ONLY_OK);
#elif defined ACC_SELF
return accessx (file, mode, ACC_SELF);

View File

@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wctype.h>
#include "exclude.h"
#include "hash.h"
@ -113,7 +114,7 @@ struct exclude
bool
fnmatch_pattern_has_wildcards (const char *str, int options)
{
char *cset = "\\?*[]";
const char *cset = "\\?*[]";
if (options & FNM_NOESCAPE)
cset++;
while (*str)
@ -199,7 +200,7 @@ string_free (void *data)
/* Create new exclude segment of given TYPE and OPTIONS, and attach it
to the tail of list in EX */
struct exclude_segment *
static struct exclude_segment *
new_exclude_segment (struct exclude *ex, enum exclude_type type, int options)
{
struct exclude_segment *sp = xzalloc (sizeof (struct exclude_segment));
@ -328,7 +329,7 @@ exclude_fnmatch (char const *pattern, char const *f, int options)
/* Return true if the exclude_pattern segment SEG excludes F. */
bool
static bool
excluded_file_pattern_p (struct exclude_segment const *seg, char const *f)
{
size_t exclude_count = seg->v.pat.exclude_count;
@ -350,7 +351,7 @@ excluded_file_pattern_p (struct exclude_segment const *seg, char const *f)
/* Return true if the exclude_hash segment SEG excludes F.
BUFFER is an auxiliary storage of the same length as F (with nul
terminator included) */
bool
static bool
excluded_file_name_p (struct exclude_segment const *seg, char const *f,
char *buffer)
{

View File

@ -19,10 +19,11 @@
/* Specification. */
#include <unistd.h>
#include <assert.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@ -30,80 +31,161 @@
#include "canonicalize.h"
#ifndef REPLACE_OPEN_DIRECTORY
# define REPLACE_OPEN_DIRECTORY 0
#endif
/* This replacement assumes that a directory is not renamed while opened
through a file descriptor. */
through a file descriptor.
FIXME: On mingw, this would be possible to enforce if we were to
also open a HANDLE to each directory currently visited by a file
descriptor, since mingw refuses to rename any in-use file system
object. */
/* Array of file descriptors opened. If it points to a directory, it stores
info about this directory; otherwise it stores an errno value of ENOTDIR. */
info about this directory. */
typedef struct
{
char *name; /* Absolute name of the directory, or NULL. */
int saved_errno; /* If name == NULL: The error code describing the failure
reason. */
/* FIXME - add a DIR* member to make dirfd possible on mingw? */
} dir_info_t;
static dir_info_t *dirs;
static size_t dirs_allocated;
/* Try to ensure dirs has enough room for a slot at index fd. */
static void
/* Try to ensure dirs has enough room for a slot at index fd. Return
false and set errno to ENOMEM on allocation failure. */
static bool
ensure_dirs_slot (size_t fd)
{
if (fd >= dirs_allocated)
{
size_t new_allocated;
dir_info_t *new_dirs;
size_t i;
new_allocated = 2 * dirs_allocated + 1;
if (new_allocated <= fd)
new_allocated = fd + 1;
new_dirs =
(dirs != NULL
? (dir_info_t *) realloc (dirs, new_allocated * sizeof (dir_info_t))
: (dir_info_t *) malloc (new_allocated * sizeof (dir_info_t)));
if (new_dirs != NULL)
{
for (i = dirs_allocated; i < new_allocated; i++)
{
new_dirs[i].name = NULL;
new_dirs[i].saved_errno = ENOTDIR;
}
dirs = new_dirs;
dirs_allocated = new_allocated;
}
? (dir_info_t *) realloc (dirs, new_allocated * sizeof *dirs)
: (dir_info_t *) malloc (new_allocated * sizeof *dirs));
if (new_dirs == NULL)
return false;
memset (new_dirs + dirs_allocated, 0,
(new_allocated - dirs_allocated) * sizeof *dirs);
dirs = new_dirs;
dirs_allocated = new_allocated;
}
return true;
}
/* Hook into the gnulib replacements for open() and close() to keep track
of the open file descriptors. */
/* Close FD, cleaning up any fd to name mapping if fd was visiting a
directory. */
void
_gl_unregister_fd (int fd)
{
if (fd >= 0 && fd < dirs_allocated)
{
if (dirs[fd].name != NULL)
free (dirs[fd].name);
free (dirs[fd].name);
dirs[fd].name = NULL;
dirs[fd].saved_errno = ENOTDIR;
}
}
void
/* Mark FD as visiting FILENAME. FD must be non-negative, and refer
to an open file descriptor. If REPLACE_OPEN_DIRECTORY is non-zero,
this should only be called if FD is visiting a directory. Close FD
and return -1 if there is insufficient memory to track the
directory name; otherwise return FD. */
int
_gl_register_fd (int fd, const char *filename)
{
struct stat statbuf;
ensure_dirs_slot (fd);
if (fd < dirs_allocated
&& fstat (fd, &statbuf) >= 0 && S_ISDIR (statbuf.st_mode))
assert (0 <= fd);
if (REPLACE_OPEN_DIRECTORY
|| (fstat (fd, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)))
{
dirs[fd].name = canonicalize_file_name (filename);
if (dirs[fd].name == NULL)
dirs[fd].saved_errno = errno;
if (!ensure_dirs_slot (fd)
|| (dirs[fd].name = canonicalize_file_name (filename)) == NULL)
{
int saved_errno = errno;
close (fd);
errno = saved_errno;
return -1;
}
}
return fd;
}
/* Mark NEWFD as a duplicate of OLDFD; useful from dup, dup2, dup3,
and fcntl. Both arguments must be valid and distinct file
descriptors. Close NEWFD and return -1 if OLDFD is tracking a
directory, but there is insufficient memory to track the same
directory in NEWFD; otherwise return NEWFD.
FIXME: Need to implement rpl_fcntl in gnulib, and have it call
this. */
int
_gl_register_dup (int oldfd, int newfd)
{
assert (0 <= oldfd && 0 <= newfd && oldfd != newfd);
if (oldfd < dirs_allocated && dirs[oldfd].name)
{
/* Duplicated a directory; must ensure newfd is allocated. */
if (!ensure_dirs_slot (newfd)
|| (dirs[newfd].name = strdup (dirs[oldfd].name)) == NULL)
{
int saved_errno = errno;
close (newfd);
errno = saved_errno;
newfd = -1;
}
}
else if (newfd < dirs_allocated)
{
/* Duplicated a non-directory; ensure newfd is cleared. */
free (dirs[newfd].name);
dirs[newfd].name = NULL;
}
return newfd;
}
/* If FD is currently visiting a directory, then return the name of
that directory. Otherwise, return NULL and set errno. */
const char *
_gl_directory_name (int fd)
{
if (0 <= fd && fd < dirs_allocated && dirs[fd].name != NULL)
return dirs[fd].name;
/* At this point, fd is either invalid, or open but not a directory.
If dup2 fails, errno is correctly EBADF. */
if (0 <= fd)
{
if (dup2 (fd, fd) == fd)
errno = ENOTDIR;
}
else
errno = EBADF;
return NULL;
}
/* Return stat information about FD in STATBUF. Needed when
rpl_open() used a dummy file to work around an open() that can't
normally visit directories. */
#if REPLACE_OPEN_DIRECTORY
int
rpl_fstat (int fd, struct stat *statbuf)
{
if (0 <= fd && fd < dirs_allocated && dirs[fd].name != NULL)
return stat (dirs[fd].name, statbuf);
return fstat (fd, statbuf);
}
#endif
/* Override opendir() and closedir(), to keep track of the open file
descriptors. Needed because there is a function dirfd(). */
@ -129,13 +211,18 @@ rpl_opendir (const char *filename)
if (dp != NULL)
{
int fd = dirfd (dp);
if (fd >= 0)
_gl_register_fd (fd, filename);
if (0 <= fd && _gl_register_fd (fd, filename) != fd)
{
int saved_errno = errno;
closedir (dp);
errno = saved_errno;
return NULL;
}
}
return dp;
}
/* Override dup() and dup2(), to keep track of open file descriptors. */
/* Override dup(), to keep track of open file descriptors. */
int
rpl_dup (int oldfd)
@ -143,102 +230,17 @@ rpl_dup (int oldfd)
{
int newfd = dup (oldfd);
if (oldfd >= 0 && newfd >= 0)
{
ensure_dirs_slot (newfd);
if (newfd < dirs_allocated)
{
if (oldfd < dirs_allocated)
{
if (dirs[oldfd].name != NULL)
{
dirs[newfd].name = strdup (dirs[oldfd].name);
if (dirs[newfd].name == NULL)
dirs[newfd].saved_errno = ENOMEM;
}
else
{
dirs[newfd].name = NULL;
dirs[newfd].saved_errno = dirs[oldfd].saved_errno;
}
}
else
{
dirs[newfd].name = NULL;
dirs[newfd].saved_errno = ENOMEM;
}
}
}
if (0 <= newfd)
newfd = _gl_register_dup (oldfd, newfd);
return newfd;
}
/* Our <unistd.h> replacement overrides dup2 twice; be sure to pick
the one we want. */
#if REPLACE_DUP2
# undef dup2
# define dup2 rpl_dup2
#endif
int
rpl_dup2_fchdir (int oldfd, int newfd)
{
int retval = dup2 (oldfd, newfd);
if (retval >= 0 && newfd != oldfd)
{
ensure_dirs_slot (newfd);
if (newfd < dirs_allocated)
{
if (oldfd < dirs_allocated)
{
if (dirs[oldfd].name != NULL)
{
dirs[newfd].name = strdup (dirs[oldfd].name);
if (dirs[newfd].name == NULL)
dirs[newfd].saved_errno = ENOMEM;
}
else
{
dirs[newfd].name = NULL;
dirs[newfd].saved_errno = dirs[oldfd].saved_errno;
}
}
else
{
dirs[newfd].name = NULL;
dirs[newfd].saved_errno = ENOMEM;
}
}
}
return retval;
}
/* Implement fchdir() in terms of chdir(). */
int
fchdir (int fd)
{
if (fd >= 0)
{
if (fd < dirs_allocated)
{
if (dirs[fd].name != NULL)
return chdir (dirs[fd].name);
else
{
errno = dirs[fd].saved_errno;
return -1;
}
}
else
{
errno = ENOMEM;
return -1;
}
}
else
{
errno = EBADF;
return -1;
}
const char *name = _gl_directory_name (fd);
return name ? chdir (name) : -1;
}

View File

@ -1,5 +1,5 @@
/* Change the protections of file relative to an open directory.
Copyright (C) 2006 Free Software Foundation, Inc.
Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -18,10 +18,12 @@
#include <config.h>
#include "openat.h"
#include <sys/stat.h>
#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#include "save-cwd.h"
#include "openat.h"
#include "openat-priv.h"
#include "save-cwd.h"
#ifndef HAVE_LCHMOD
/* Use a different name, to avoid conflicting with any
@ -35,15 +37,15 @@ static int lchmod (char const *f, mode_t m) { errno = ENOSYS; return -1; }
Invoke chmod or lchmod on file, FILE, using mode MODE, in the directory
open on descriptor FD. If possible, do it without changing the
working directory. Otherwise, resort to using save_cwd/fchdir,
then mkdir/restore_cwd. If either the save_cwd or the restore_cwd
fails, then give a diagnostic and exit nonzero.
then (chmod|lchmod)/restore_cwd. If either the save_cwd or the
restore_cwd fails, then give a diagnostic and exit nonzero.
Note that an attempt to use a FLAG value of AT_SYMLINK_NOFOLLOW
on a system without lchmod support causes this function to fail. */
#define AT_FUNC_NAME fchmodat
#define AT_FUNC_F1 lchmod
#define AT_FUNC_F2 chmod
#define AT_FUNC_USE_F1_COND flag == AT_SYMLINK_NOFOLLOW
#define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
#define AT_FUNC_POST_FILE_PARAM_DECLS , mode_t mode, int flag
#define AT_FUNC_POST_FILE_ARGS , mode
#include "at-func.c"

View File

@ -4,7 +4,7 @@
when the buggy fchownat-with-AT_SYMLINK_NOFOLLOW operates on a symlink, it
mistakenly affects the symlink referent, rather than the symlink itself.
Copyright (C) 2006-2007 Free Software Foundation, Inc.
Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -23,26 +23,25 @@
#include <config.h>
#include "openat.h"
#include <unistd.h>
#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#include "save-cwd.h"
#include "openat.h"
#include "openat-priv.h"
#include "save-cwd.h"
/* Replacement for Solaris' function by the same name.
Invoke chown or lchown on file, FILE, using OWNER and GROUP, in the
directory open on descriptor FD. If FLAG is AT_SYMLINK_NOFOLLOW, then
use lchown, otherwise, use chown. If possible, do it without changing
the working directory. Otherwise, resort to using save_cwd/fchdir,
then mkdir/restore_cwd. If either the save_cwd or the restore_cwd
fails, then give a diagnostic and exit nonzero. */
then (chown|lchown)/restore_cwd. If either the save_cwd or the
restore_cwd fails, then give a diagnostic and exit nonzero. */
#define AT_FUNC_NAME fchownat
#define AT_FUNC_F1 lchown
#define AT_FUNC_F2 chown
#define AT_FUNC_USE_F1_COND flag == AT_SYMLINK_NOFOLLOW
#define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
#define AT_FUNC_POST_FILE_PARAM_DECLS , uid_t owner, gid_t group, int flag
#define AT_FUNC_POST_FILE_ARGS , owner, group
#include "at-func.c"

View File

@ -1,6 +1,6 @@
/* Like fcntl.h, but redefine some names to avoid glitches.
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 2005, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -25,3 +25,8 @@
#undef creat
#define creat creat_safer
#if GNULIB_OPENAT_SAFER
# undef openat
# define openat openat_safer
#endif

View File

@ -1,6 +1,6 @@
/* Invoke fcntl-like functions, but avoid some glitches.
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 2005, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -21,3 +21,7 @@
int open_safer (char const *, int, ...);
int creat_safer (char const *, mode_t);
#if GNULIB_OPENAT_SAFER
int openat_safer (int, char const *, int, ...);
#endif

View File

@ -1,6 +1,6 @@
/* Like <fcntl.h>, but with non-working flags defined to 0.
Copyright (C) 2006-2008 Free Software Foundation, Inc.
Copyright (C) 2006-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -44,6 +44,9 @@
#define _GL_FCNTL_H
/* The definition of GL_LINK_WARNING is copied here. */
/* Declare overridden functions. */
#ifdef __cplusplus
@ -58,15 +61,29 @@ extern int open (const char *filename, int flags, ...);
# endif
#endif
#ifdef FCHDIR_REPLACEMENT
/* gnulib internal function. */
extern void _gl_register_fd (int fd, const char *filename);
#if @GNULIB_OPENAT@
# if !@HAVE_OPENAT@
# undef openat
# define openat rpl_openat
int openat (int fd, char const *file, int flags, /* mode_t mode */ ...);
# endif
#elif defined GNULIB_POSIXCHECK
# undef openat
# define openat(f,u,g) \
(GL_LINK_WARNING ("openat is not portable - " \
"use gnulib module openat for portability"), \
openat)
#endif
#ifdef __cplusplus
}
#endif
/* Fix up the FD_* macros. */
#ifndef FD_CLOEXEC
# define FD_CLOEXEC 1
#endif
/* Fix up the O_* macros. */
@ -75,6 +92,12 @@ extern void _gl_register_fd (int fd, const char *filename);
# define O_DIRECT O_DIRECTIO
#endif
#if !defined O_CLOEXEC && defined O_NOINHERIT
/* Mingw spells it `O_NOINHERIT'. Intentionally leave it
undefined if not available. */
# define O_CLOEXEC O_NOINHERIT
#endif
#ifndef O_DIRECT
# define O_DIRECT 0
#endif
@ -119,6 +142,10 @@ extern void _gl_register_fd (int fd, const char *filename);
# define O_SYNC 0
#endif
#ifndef O_TTY_INIT
# define O_TTY_INIT 0
#endif
/* For systems that distinguish between text and binary I/O.
O_BINARY is usually declared in fcntl.h */
#if !defined O_BINARY && defined _O_BINARY
@ -138,6 +165,42 @@ extern void _gl_register_fd (int fd, const char *filename);
# define O_TEXT 0
#endif
/* Fix up the AT_* macros. */
/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
value exceeds INT_MAX, so its use as an int doesn't conform to the
C standard, and GCC and Sun C complain in some cases. If the bug
is present, undef AT_FDCWD here, so it can be redefined below. */
#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
# undef AT_FDCWD
#endif
/* Use the same bit pattern as Solaris 9, but with the proper
signedness. The bit pattern is important, in case this actually is
Solaris with the above workaround. */
#ifndef AT_FDCWD
# define AT_FDCWD (-3041965)
#endif
/* Use the same values as Solaris 9. This shouldn't matter, but
there's no real reason to differ. */
#ifndef AT_SYMLINK_NOFOLLOW
# define AT_SYMLINK_NOFOLLOW 4096
#endif
#ifndef AT_REMOVEDIR
# define AT_REMOVEDIR 1
#endif
/* Solaris 9 lacks these two, so just pick unique values. */
#ifndef AT_SYMLINK_FOLLOW
# define AT_SYMLINK_FOLLOW 2
#endif
#ifndef AT_EACCESS
# define AT_EACCESS 4
#endif
#endif /* _GL_FCNTL_H */
#endif /* _GL_FCNTL_H */

View File

@ -0,0 +1,107 @@
/* provide a replacement fdopendir function
Copyright (C) 2004-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* written by Jim Meyering */
#include <config.h>
#include <dirent.h>
#include <stdlib.h>
#include <unistd.h>
#include "openat.h"
#include "openat-priv.h"
#include "save-cwd.h"
#if GNULIB_DIRENT_SAFER
# include "dirent--.h"
#endif
/* Replacement for Solaris' function by the same name.
<http://www.google.com/search?q=fdopendir+site:docs.sun.com>
First, try to simulate it via opendir ("/proc/self/fd/FD"). Failing
that, simulate it by using fchdir metadata, or by doing
save_cwd/fchdir/opendir(".")/restore_cwd.
If either the save_cwd or the restore_cwd fails (relatively unlikely),
then give a diagnostic and exit nonzero.
Otherwise, this function works just like Solaris' fdopendir.
W A R N I N G:
Unlike other fd-related functions, this one effectively consumes
its FD parameter. The caller should not close or otherwise
manipulate FD if this function returns successfully. Also, this
implementation does not guarantee that dirfd(fdopendir(n))==n;
the open directory stream may use a clone of FD, or have no
associated fd at all. */
DIR *
fdopendir (int fd)
{
int saved_errno;
DIR *dir;
char buf[OPENAT_BUFFER_SIZE];
char *proc_file = openat_proc_name (buf, fd, ".");
if (proc_file)
{
dir = opendir (proc_file);
saved_errno = errno;
}
else
{
dir = NULL;
saved_errno = EOPNOTSUPP;
}
/* If the syscall fails with an expected errno value, resort to
save_cwd/restore_cwd. */
if (! dir && EXPECTED_ERRNO (saved_errno))
{
#if REPLACE_FCHDIR
const char *name = _gl_directory_name (fd);
if (name)
dir = opendir (name);
saved_errno = errno;
#else /* !REPLACE_FCHDIR */
struct saved_cwd saved_cwd;
if (save_cwd (&saved_cwd) != 0)
openat_save_fail (errno);
if (fchdir (fd) != 0)
{
dir = NULL;
saved_errno = errno;
}
else
{
dir = opendir (".");
saved_errno = errno;
if (restore_cwd (&saved_cwd) != 0)
openat_restore_fail (errno);
}
free_cwd (&saved_cwd);
#endif /* !REPLACE_FCHDIR */
}
if (dir)
close (fd);
if (proc_file != buf)
free (proc_file);
errno = saved_errno;
return dir;
}

View File

@ -0,0 +1,105 @@
/* Open a stream to a file.
Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
#include <config.h>
/* Get the original definition of fopen. It might be defined as a macro. */
#define __need_FILE
#include <stdio.h>
#undef __need_FILE
static inline FILE *
orig_fopen (const char *filename, const char *mode)
{
return fopen (filename, mode);
}
/* Specification. */
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
FILE *
rpl_fopen (const char *filename, const char *mode)
{
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
if (strcmp (filename, "/dev/null") == 0)
filename = "NUL";
#endif
#if FOPEN_TRAILING_SLASH_BUG
/* If the filename ends in a slash and a mode that requires write access is
specified, then fail.
Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html>
says that
"A pathname that contains at least one non-slash character and that
ends with one or more trailing slashes shall be resolved as if a
single dot character ( '.' ) were appended to the pathname."
and
"The special filename dot shall refer to the directory specified by
its predecessor."
If the named file already exists as a directory, then if a mode that
requires write access is specified, fopen() must fail because POSIX
<http://www.opengroup.org/susv3/functions/fopen.html> says that it
fails with errno = EISDIR in this case.
If the named file does not exist or does not name a directory, then
fopen() must fail since the file does not contain a '.' directory. */
{
size_t len = strlen (filename);
if (len > 0 && filename[len - 1] == '/')
{
int fd;
struct stat statbuf;
FILE *fp;
if (mode[0] == 'w' || mode[0] == 'a')
{
errno = EISDIR;
return NULL;
}
fd = open (filename, O_RDONLY);
if (fd < 0)
return NULL;
if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode))
{
close (fd);
errno = ENOTDIR;
return NULL;
}
fp = fdopen (fd, mode);
if (fp == NULL)
{
int saved_errno = errno;
close (fd);
errno = saved_errno;
}
return fp;
}
}
# endif
return orig_fopen (filename, mode);
}

View File

@ -1,6 +1,6 @@
/* Work around an fstatat bug on Solaris 9.
Copyright (C) 2006 Free Software Foundation, Inc.
Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -19,12 +19,14 @@
#include <config.h>
#define COMPILING_FSTATAT 1
#include "openat.h"
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#undef fstatat
/* fstatat should always follow symbolic links that end in /, but on
Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified. This is
the same problem that lstat.c addresses, so solve it in a similar

View File

@ -69,8 +69,12 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#if ! _LIBC
# include "fcntl--.h"
# include "openat.h"
# include "dirent--.h"
# include "unistd--.h"
/* FIXME - use fcntl(F_DUPFD_CLOEXEC)/openat(O_CLOEXEC) once they are
supported. */
# include "cloexec.h"
# include "openat.h"
# include "same-inode.h"
#endif
@ -228,10 +232,6 @@ static void free_dir (FTS *fts) {}
# define SIZE_MAX ((size_t) -1)
#endif
#ifndef O_DIRECTORY
# define O_DIRECTORY 0
#endif
#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
#define STREQ(a, b) (strcmp ((a), (b)) == 0)
@ -309,11 +309,13 @@ static inline DIR *
internal_function
opendirat (int fd, char const *dir)
{
int new_fd = openat (fd, dir, O_RDONLY);
int new_fd = openat (fd, dir,
O_RDONLY | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
DIR *dirp;
if (new_fd < 0)
return NULL;
set_cloexec_flag (new_fd, true);
dirp = fdopendir (new_fd);
if (dirp == NULL)
{
@ -365,9 +367,12 @@ diropen (FTS const *sp, char const *dir)
int open_flags = (O_RDONLY | O_DIRECTORY | O_NOCTTY | O_NONBLOCK
| (ISSET (FTS_PHYSICAL) ? O_NOFOLLOW : 0));
return (ISSET (FTS_CWDFD)
? openat (sp->fts_cwd_fd, dir, open_flags)
: open (dir, open_flags));
int fd = (ISSET (FTS_CWDFD)
? openat (sp->fts_cwd_fd, dir, open_flags)
: open (dir, open_flags));
if (0 <= fd)
set_cloexec_flag (fd, true);
return fd;
}
FTS *
@ -606,14 +611,20 @@ fts_close (FTS *sp)
if (ISSET(FTS_CWDFD))
{
if (0 <= sp->fts_cwd_fd)
close (sp->fts_cwd_fd);
if (close (sp->fts_cwd_fd))
saved_errno = errno;
}
else if (!ISSET(FTS_NOCHDIR))
{
/* Return to original directory, save errno if necessary. */
if (fchdir(sp->fts_rfd))
saved_errno = errno;
close(sp->fts_rfd);
/* If close fails, record errno only if saved_errno is zero,
so that we report the probably-more-meaningful fchdir errno. */
if (close (sp->fts_rfd))
if (saved_errno == 0)
saved_errno = errno;
}
fd_ring_clear (&sp->fts_fd_ring);
@ -1302,7 +1313,10 @@ fts_build (register FTS *sp, int type)
if (nlinks || type == BREAD) {
int dir_fd = dirfd(dirp);
if (ISSET(FTS_CWDFD) && 0 <= dir_fd)
dir_fd = dup (dir_fd);
{
dir_fd = dup (dir_fd);
set_cloexec_flag (dir_fd, true);
}
if (dir_fd < 0 || fts_safe_changedir(sp, cur, dir_fd, NULL)) {
if (nlinks && type == BREAD)
cur->fts_errno = errno;

View File

@ -233,12 +233,30 @@ typedef struct _ftsent {
char fts_name[1]; /* file name */
} FTSENT;
#ifndef __GNUC_PREREQ
# if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
# else
# define __GNUC_PREREQ(maj, min) 0
# endif
#endif
#if __GNUC_PREREQ (3,4)
# undef __attribute_warn_unused_result__
# define __attribute_warn_unused_result__ \
__attribute__ ((__warn_unused_result__))
#else
# define __attribute_warn_unused_result__ /* empty */
#endif
__BEGIN_DECLS
FTSENT *fts_children (FTS *, int) __THROW;
int fts_close (FTS *) __THROW;
FTSENT *fts_children (FTS *, int) __THROW __attribute_warn_unused_result__;
int fts_close (FTS *) __THROW __attribute_warn_unused_result__;
FTS *fts_open (char * const *, int,
int (*)(const FTSENT **, const FTSENT **)) __THROW;
FTSENT *fts_read (FTS *) __THROW;
int (*)(const FTSENT **, const FTSENT **))
__THROW __attribute_warn_unused_result__;
FTSENT *fts_read (FTS *) __THROW __attribute_warn_unused_result__;
int fts_set (FTS *, FTSENT *, int) __THROW;
__END_DECLS

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991-1999, 2004-2008 Free Software Foundation, Inc.
/* Copyright (C) 1991-1999, 2004-2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify
@ -59,20 +59,6 @@
#include <limits.h>
/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
value exceeds INT_MAX, so its use as an int doesn't conform to the
C standard, and GCC and Sun C complain in some cases. */
#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
# undef AT_FDCWD
# define AT_FDCWD (-3041965)
#endif
#ifdef ENAMETOOLONG
# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
#else
# define is_ENAMETOOLONG(x) 0
#endif
#ifndef MAX
# define MAX(a, b) ((a) < (b) ? (b) : (a))
#endif
@ -103,7 +89,11 @@
#endif
/* The results of opendir() in this file are not used with dirfd and fchdir,
therefore save some unnecessary recursion in fchdir.c. */
and we do not leak fds to any single-threaded code that could use stdio,
therefore save some unnecessary recursion in fchdir.c.
FIXME - if the kernel ever adds support for multi-thread safety for
avoiding standard fds, then we should use opendir_safer and
openat_safer. */
#undef opendir
#undef closedir
@ -160,7 +150,7 @@ __getcwd (char *buf, size_t size)
# undef getcwd
dir = getcwd (buf, size);
if (dir || (errno != ERANGE && !is_ENAMETOOLONG (errno) && errno != ENOENT))
if (dir || (errno != ERANGE && errno != ENAMETOOLONG && errno != ENOENT))
return dir;
#endif

View File

@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libcoreutils --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=gnulib-tests --aux-dir=build-aux --with-tests --avoid=canonicalize-lgpl --avoid=dummy --avoid=lock --no-libtool --macro-prefix=gl acl alloca announce-gen areadlink-with-size argmatch argv-iter assert atexit autobuild backupfile base64 c-strcase c-strtod c-strtold calloc canon-host canonicalize chown cloexec closein closeout config-h configmake crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 cycle-check d-ino d-type diacrit dirfd dirname dup2 error euidaccess exclude exitfail fchdir fcntl fcntl-safer fdl file-type fileblocks filemode filenamecat filevercmp fnmatch-gnu fopen-safer fprintftime fseeko fsusage ftello ftruncate fts gendocs getdate getgroups gethrxtime getline getloadavg getndelim2 getopt-gnu getpagesize getpass-gnu gettext gettime gettimeofday getugroups getusershell git-version-gen gitlog-to-changelog gnu-make gnumakefile gnupload group-member hard-locale hash hash-pjw host-os human idcache ignore-value inttostr inttypes isapipe lchmod lchown lib-ignore linebuffer link-follow long-options lstat maintainer-makefile malloc manywarnings mbrtowc mbsalign mbswidth memcasecmp memchr memcmp memcmp2 memcpy memmove mempcpy memrchr memset mgetgroups mkancesdirs mkdir mkdir-p mkstemp mktime modechange mountlist mpsort obstack pathmax perl physmem posix-shell posixtm posixver priv-set progname propername putenv quote quotearg raise randint randperm readlink readtokens readtokens0 readutmp realloc regex rename rename-dest-slash rmdir rmdir-errno root-dev-ino rpmatch safe-read same save-cwd savedir savewd selinux-at settime sig2str sigaction ssize_t stat-macros stat-time stdbool stdlib-safer stpcpy stpncpy strcspn strdup strftime strpbrk strtod strtoimax strtol strtoumax strverscmp sys_stat timespec tzset unicodeio unistd-safer unlink-busy unlinkdir unlocked-io update-copyright uptime useless-if-before-free userspec utimecmp utimens vasprintf-posix vc-list-files verify verror version-etc-fsf warnings wcwidth winsz-ioctl winsz-termios write-any-file xalloc xfreopen xgetcwd xgethostname xmemcoll xnanosleep xprintf xprintf-posix xstrtod xstrtoimax xstrtol xstrtold xstrtoumax yesno
# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libcoreutils --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=gnulib-tests --aux-dir=build-aux --with-tests --avoid=canonicalize-lgpl --avoid=dummy --avoid=lock --no-libtool --macro-prefix=gl acl alloca announce-gen areadlink-with-size argmatch argv-iter assert atexit autobuild backupfile base64 c-strcase c-strtod c-strtold calloc canon-host canonicalize chown cloexec closein closeout config-h configmake crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 cycle-check d-ino d-type diacrit dirfd dirname dup2 error euidaccess exclude exitfail fchdir fcntl fcntl-safer fdl file-type fileblocks filemode filenamecat filevercmp fnmatch-gnu fopen-safer fprintftime fseeko fsusage ftello ftruncate fts gendocs getdate getgroups gethrxtime getline getloadavg getndelim2 getopt-gnu getpagesize getpass-gnu gettext gettime gettimeofday getugroups getusershell git-version-gen gitlog-to-changelog gnu-make gnumakefile gnupload group-member hard-locale hash hash-pjw host-os human idcache ignore-value inttostr inttypes isapipe lchmod lchown lib-ignore linebuffer link link-follow long-options lstat maintainer-makefile malloc manywarnings mbrtowc mbsalign mbswidth memcasecmp memchr memcmp memcmp2 memcpy memmove mempcpy memrchr memset mgetgroups mkancesdirs mkdir mkdir-p mkstemp mktime modechange mountlist mpsort obstack pathmax perl physmem posix-shell posixtm posixver priv-set progname propername putenv quote quotearg raise randint randperm readlink readtokens readtokens0 readutmp realloc regex rename rename-dest-slash rmdir rmdir-errno root-dev-ino rpmatch safe-read same save-cwd savedir savewd selinux-at settime sig2str sigaction ssize_t stat-macros stat-time stdbool stdlib-safer stpcpy stpncpy strcspn strdup strftime strpbrk strtod strtoimax strtol strtoumax strverscmp sys_stat timespec tzset unicodeio unistd-safer unlink-busy unlinkdir unlocked-io update-copyright uptime useless-if-before-free userspec utimecmp utimens vasprintf-posix vc-list-files verify verror version-etc-fsf warnings wcwidth winsz-ioctl winsz-termios write-any-file xalloc xfreopen xgetcwd xgethostname xmemcoll xnanosleep xprintf xprintf-posix xstrtod xstrtoimax xstrtol xstrtold xstrtoumax yesno
AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
@ -71,9 +71,10 @@ BUILT_SOURCES += $(ALLOCA_H)
# We need the following in order to create <alloca.h> when the system
# doesn't have one that works with the given compiler.
alloca.h: alloca.in.h
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/alloca.in.h; \
} > $@-t
} > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += alloca.h alloca.h-t
@ -118,8 +119,8 @@ BUILT_SOURCES += $(ARPA_INET_H)
# We need the following in order to create <arpa/inet.h> when the system
# doesn't have one.
arpa/inet.h: arpa_inet.in.h
@MKDIR_P@ arpa
rm -f $@-t $@
$(AM_V_at)$(MKDIR_P) arpa
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -131,7 +132,7 @@ arpa/inet.h: arpa_inet.in.h
-e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/arpa_inet.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
MOSTLYCLEANDIRS += arpa
@ -336,7 +337,7 @@ EXTRA_libcoreutils_a_SOURCES += closeout.c
# The Automake-defined pkg* macros are appended, in the order
# listed in the Automake 1.10a+ documentation.
configmake.h: Makefile
rm -f $@-t
$(AM_V_GEN)rm -f $@-t && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
echo '#define PREFIX "$(prefix)"'; \
echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
@ -365,7 +366,7 @@ configmake.h: Makefile
echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
echo '#define PKGLIBDIR "$(pkglibdir)"'; \
echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
} | sed '/""/d' > $@-t
} | sed '/""/d' > $@-t && \
if test -f $@ && cmp $@-t $@ > /dev/null; then \
rm -f $@-t; \
else \
@ -442,21 +443,23 @@ BUILT_SOURCES += $(DIRENT_H)
# We need the following in order to create <dirent.h> when the system
# doesn't have one that works with the given compiler.
dirent.h: dirent.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
-e 's|@''GNULIB_DIRFD''@|$(GNULIB_DIRFD)|g' \
-e 's|@''GNULIB_FDOPENDIR''@|$(GNULIB_FDOPENDIR)|g' \
-e 's|@''GNULIB_SCANDIR''@|$(GNULIB_SCANDIR)|g' \
-e 's|@''GNULIB_ALPHASORT''@|$(GNULIB_ALPHASORT)|g' \
-e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
-e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
-e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
-e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
-e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/dirent.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += dirent.h dirent.h-t
@ -464,6 +467,15 @@ EXTRA_DIST += dirent.in.h
## end gnulib module dirent
## begin gnulib module dirent-safer
EXTRA_DIST += dirent--.h dirent-safer.h opendir-safer.c
EXTRA_libcoreutils_a_SOURCES += opendir-safer.c
## end gnulib module dirent-safer
## begin gnulib module dirfd
@ -498,7 +510,7 @@ BUILT_SOURCES += $(ERRNO_H)
# We need the following in order to create <errno.h> when the system
# doesn't have one that is POSIX compliant.
errno.h: errno.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -510,7 +522,7 @@ errno.h: errno.in.h
-e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
-e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
< $(srcdir)/errno.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += errno.h errno.h-t
@ -572,28 +584,31 @@ EXTRA_libcoreutils_a_SOURCES += fclose.c
## end gnulib module fclose
## begin gnulib module fcntl
## begin gnulib module fcntl-h
BUILT_SOURCES += $(FCNTL_H)
# We need the following in order to create <fcntl.h> when the system
# doesn't have one that works with the given compiler.
fcntl.h: fcntl.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
-e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
-e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
-e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/fcntl.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += fcntl.h fcntl.h-t
EXTRA_DIST += fcntl.in.h
## end gnulib module fcntl
## end gnulib module fcntl-h
## begin gnulib module fcntl-safer
@ -604,6 +619,15 @@ EXTRA_libcoreutils_a_SOURCES += creat-safer.c open-safer.c
## end gnulib module fcntl-safer
## begin gnulib module fdopendir
EXTRA_DIST += fdopendir.c openat-priv.h openat-proc.c
EXTRA_libcoreutils_a_SOURCES += fdopendir.c openat-proc.c
## end gnulib module fdopendir
## begin gnulib module fflush
@ -672,13 +696,13 @@ BUILT_SOURCES += $(FLOAT_H)
# We need the following in order to create <float.h> when the system
# doesn't have one that works with the given compiler.
float.h: float.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
< $(srcdir)/float.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += float.h float.h-t
@ -693,9 +717,10 @@ BUILT_SOURCES += $(FNMATCH_H)
# We need the following in order to create <fnmatch.h> when the system
# doesn't have one that supports the required API.
fnmatch.h: fnmatch.in.h
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/fnmatch.in.h; \
} > $@-t
} > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
@ -705,6 +730,15 @@ EXTRA_libcoreutils_a_SOURCES += fnmatch.c fnmatch_loop.c
## end gnulib module fnmatch
## begin gnulib module fopen
EXTRA_DIST += fopen.c
EXTRA_libcoreutils_a_SOURCES += fopen.c
## end gnulib module fopen
## begin gnulib module fopen-safer
@ -969,9 +1003,10 @@ BUILT_SOURCES += $(GETOPT_H)
# We need the following in order to create <getopt.h> when the system
# doesn't have one that works with the given compiler.
getopt.h: getopt.in.h
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/getopt.in.h; \
} > $@-t
} > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += getopt.h getopt.h-t
@ -1180,7 +1215,7 @@ BUILT_SOURCES += $(ICONV_H)
# We need the following in order to create <iconv.h> when the system
# doesn't have one that works with the given compiler.
iconv.h: iconv.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -1190,7 +1225,7 @@ iconv.h: iconv.in.h
-e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
-e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \
< $(srcdir)/iconv.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += iconv.h iconv.h-t
@ -1206,12 +1241,15 @@ iconv_open-irix.h: iconv_open-irix.gperf
iconv_open-osf.h: iconv_open-osf.gperf
$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t
mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h
MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t
MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h
EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h
iconv_open-solaris.h: iconv_open-solaris.gperf
$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t
mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h
BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t
MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
EXTRA_DIST += iconv.in.h iconv_open-aix.gperf iconv_open-hpux.gperf iconv_open-irix.gperf iconv_open-osf.gperf iconv_open.c
EXTRA_DIST += iconv.in.h iconv_open-aix.gperf iconv_open-hpux.gperf iconv_open-irix.gperf iconv_open-osf.gperf iconv_open-solaris.gperf iconv_open.c
EXTRA_libcoreutils_a_SOURCES += iconv_open.c
@ -1264,7 +1302,7 @@ BUILT_SOURCES += $(INTTYPES_H)
# We need the following in order to create <inttypes.h> when the system
# doesn't have one that works with the given compiler.
inttypes.h: inttypes.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@ -1289,7 +1327,7 @@ inttypes.h: inttypes.in.h
-e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/inttypes.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += inttypes.h inttypes.h-t
@ -1348,6 +1386,15 @@ libcoreutils_a_SOURCES += linebuffer.h linebuffer.c
## end gnulib module linebuffer
## begin gnulib module link
EXTRA_DIST += link.c
EXTRA_libcoreutils_a_SOURCES += link.c
## end gnulib module link
## begin gnulib module link-warning
LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h
@ -1414,14 +1461,14 @@ uninstall-localcharset: all-local
fi
charset.alias: config.charset
rm -f t-$@ $@
$(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
$(AM_V_GEN)rm -f t-$@ $@ && \
$(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
mv t-$@ $@
SUFFIXES += .sed .sin
.sin.sed:
rm -f t-$@ $@
sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
$(AM_V_GEN)rm -f t-$@ $@ && \
sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
mv t-$@ $@
CLEANFILES += charset.alias ref-add.sed ref-del.sed
@ -1496,7 +1543,7 @@ BUILT_SOURCES += math.h
# We need the following in order to create <math.h> when the system
# doesn't have one that works with the given compiler.
math.h: math.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -1558,7 +1605,7 @@ math.h: math.in.h
-e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/math.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += math.h math.h-t
@ -1848,7 +1895,7 @@ BUILT_SOURCES += $(NETDB_H)
# We need the following in order to create <netdb.h> when the system
# doesn't have one that works with the given compiler.
netdb.h: netdb.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -1861,7 +1908,7 @@ netdb.h: netdb.in.h
-e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
-e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
< $(srcdir)/netdb.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += netdb.h netdb.h-t
@ -1876,15 +1923,15 @@ BUILT_SOURCES += $(NETINET_IN_H)
# We need the following in order to create <netinet/in.h> when the system
# doesn't have one.
netinet/in.h: netinet_in.in.h
@MKDIR_P@ netinet
rm -f $@-t $@
$(AM_V_at)$(MKDIR_P) netinet
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
-e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
< $(srcdir)/netinet_in.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
MOSTLYCLEANDIRS += netinet
@ -1926,6 +1973,15 @@ libcoreutils_a_SOURCES += openat-die.c
## end gnulib module openat-die
## begin gnulib module openat-safer
EXTRA_DIST += fcntl--.h fcntl-safer.h openat-safer.c
EXTRA_libcoreutils_a_SOURCES += openat-safer.c
## end gnulib module openat-safer
## begin gnulib module pathmax
@ -2254,19 +2310,19 @@ libcoreutils_a_SOURCES += se-context.in.h se-selinux.in.h
BUILT_SOURCES += $(SELINUX_SELINUX_H)
selinux/selinux.h: se-selinux.in.h
rm -f $@-t $@
$(MKDIR_P) selinux
cp $(srcdir)/se-selinux.in.h $@-t
chmod a-x $@-t
$(AM_V_at)$(MKDIR_P) selinux
$(AM_V_GEN)rm -f $@-t $@ && \
cp $(srcdir)/se-selinux.in.h $@-t && \
chmod a-x $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += selinux/selinux.h selinux/selinux.h-t
BUILT_SOURCES += $(SELINUX_CONTEXT_H)
selinux/context.h: se-context.in.h
rm -f $@-t $@
$(MKDIR_P) selinux
cp $(srcdir)/se-context.in.h $@-t
chmod a-x $@-t
$(AM_V_at)$(MKDIR_P) selinux
$(AM_V_GEN)rm -f $@-t $@ && \
cp $(srcdir)/se-context.in.h $@-t && \
chmod a-x $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += selinux/context.h selinux/context.h-t
MOSTLYCLEANDIRS += selinux
@ -2316,7 +2372,7 @@ BUILT_SOURCES += signal.h
# We need the following in order to create <signal.h> when the system
# doesn't have a complete one.
signal.h: signal.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -2332,7 +2388,7 @@ signal.h: signal.in.h
-e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/signal.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += signal.h signal.h-t
@ -2402,13 +2458,13 @@ BUILT_SOURCES += $(STDARG_H)
# We need the following in order to create <stdarg.h> when the system
# doesn't have one that works with the given compiler.
stdarg.h: stdarg.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
< $(srcdir)/stdarg.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdarg.h stdarg.h-t
@ -2423,10 +2479,10 @@ BUILT_SOURCES += $(STDBOOL_H)
# We need the following in order to create <stdbool.h> when the system
# doesn't have one that works.
stdbool.h: stdbool.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdbool.h stdbool.h-t
@ -2441,7 +2497,7 @@ BUILT_SOURCES += $(STDDEF_H)
# We need the following in order to create <stddef.h> when the system
# doesn't have one that works with the given compiler.
stddef.h: stddef.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -2449,7 +2505,7 @@ stddef.h: stddef.in.h
-e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
-e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
< $(srcdir)/stddef.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stddef.h stddef.h-t
@ -2464,7 +2520,7 @@ BUILT_SOURCES += $(STDINT_H)
# We need the following in order to create <stdint.h> when the system
# doesn't have one that works with the given compiler.
stdint.h: stdint.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@ -2491,7 +2547,7 @@ stdint.h: stdint.in.h
-e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
-e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
< $(srcdir)/stdint.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdint.h stdint.h-t
@ -2506,83 +2562,87 @@ BUILT_SOURCES += stdio.h
# We need the following in order to create <stdio.h> when the system
# doesn't have one that works with the given compiler.
stdio.h: stdio.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
-e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
-e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
-e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
-e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
-e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
-e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
-e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
-e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
-e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
-e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
-e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
-e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
-e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
-e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
-e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
-e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
-e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
-e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
-e 's|@''GNULIB_POPEN''@|$(GNULIB_POPEN)|g' \
-e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
-e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
-e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
-e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
-e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
-e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \
-e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
-e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
-e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
-e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
-e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
-e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
-e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
-e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
-e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
-e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
-e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
-e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
-e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
-e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
-e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
-e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
-e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
-e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
-e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
-e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
-e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
-e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
-e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
-e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
-e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
-e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
-e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
-e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
-e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
-e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
-e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
-e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
-e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
-e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
-e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
-e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
-e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
-e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
-e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
-e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
-e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
-e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
-e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
-e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
-e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
-e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
-e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
-e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
-e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
-e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
-e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
-e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
-e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
-e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
-e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
-e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
-e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
-e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
-e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
-e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/stdio.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdio.h stdio.h-t
@ -2599,7 +2659,7 @@ BUILT_SOURCES += stdlib.h
# We need the following in order to create <stdlib.h> when the system
# doesn't have one that works with the given compiler.
stdlib.h: stdlib.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -2612,6 +2672,7 @@ stdlib.h: stdlib.in.h
-e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
-e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
-e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
-e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \
-e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
-e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
-e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
@ -2626,6 +2687,7 @@ stdlib.h: stdlib.in.h
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
-e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
-e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
@ -2643,7 +2705,7 @@ stdlib.h: stdlib.in.h
-e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/stdlib.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdlib.h stdlib.h-t
@ -2745,7 +2807,7 @@ BUILT_SOURCES += string.h
# We need the following in order to create <string.h> when the system
# doesn't have one that works with the given compiler.
string.h: string.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -2791,7 +2853,6 @@ string.h: string.in.h
-e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
-e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
-e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
-e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \
-e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
-e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
-e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
@ -2807,10 +2868,13 @@ string.h: string.in.h
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
-e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
-e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
-e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/string.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += string.h string.h-t
@ -2940,8 +3004,8 @@ BUILT_SOURCES += $(SYS_SELECT_H)
# We need the following in order to create <sys/select.h> when the system
# doesn't have one that works with the given compiler.
sys/select.h: sys_select.in.h
@MKDIR_P@ sys
rm -f $@-t $@
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -2952,7 +3016,7 @@ sys/select.h: sys_select.in.h
-e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_select.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += sys/select.h sys/select.h-t
MOSTLYCLEANDIRS += sys
@ -2968,7 +3032,8 @@ BUILT_SOURCES += $(SYS_SOCKET_H)
# We need the following in order to create <sys/socket.h> when the system
# doesn't have one that works with the given compiler.
sys/socket.h: sys_socket.in.h
@MKDIR_P@ sys
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -2989,13 +3054,15 @@ sys/socket.h: sys_socket.in.h
-e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \
-e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \
-e 's|@''GNULIB_SHUTDOWN''@|$(GNULIB_SHUTDOWN)|g' \
-e 's|@''GNULIB_ACCEPT4''@|$(GNULIB_ACCEPT4)|g' \
-e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
-e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
-e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
-e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
-e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_socket.in.h; \
} > $@-t
} > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
MOSTLYCLEANDIRS += sys
@ -3006,26 +3073,38 @@ EXTRA_DIST += sys_socket.in.h
## begin gnulib module sys_stat
BUILT_SOURCES += $(SYS_STAT_H)
BUILT_SOURCES += sys/stat.h
# We need the following in order to create <sys/stat.h> when the system
# has one that is incomplete.
sys/stat.h: sys_stat.in.h
@MKDIR_P@ sys
rm -f $@-t $@
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
-e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
-e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
-e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
-e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
-e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
-e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
-e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
-e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
-e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
-e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
-e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
-e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
-e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
-e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
-e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
-e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
-e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
-e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_stat.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
MOSTLYCLEANDIRS += sys
@ -3041,8 +3120,8 @@ BUILT_SOURCES += $(SYS_TIME_H)
# We need the following in order to create <sys/time.h> when the system
# doesn't have one that works with the given compiler.
sys/time.h: sys_time.in.h
@MKDIR_P@ sys
rm -f $@-t $@
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@ -3051,7 +3130,7 @@ sys/time.h: sys_time.in.h
-e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
-e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
< $(srcdir)/sys_time.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += sys/time.h sys/time.h-t
@ -3075,7 +3154,7 @@ BUILT_SOURCES += time.h
# We need the following in order to create <time.h> when the system
# doesn't have one that works with the given compiler.
time.h: time.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -3088,7 +3167,7 @@ time.h: time.in.h
-e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
< $(srcdir)/time.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += time.h time.h-t
@ -3139,7 +3218,7 @@ BUILT_SOURCES += unistd.h
# We need the following in order to create an empty placeholder for
# <unistd.h> when the system doesn't have one.
unistd.h: unistd.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@ -3148,9 +3227,12 @@ unistd.h: unistd.in.h
-e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
-e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
-e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
-e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \
-e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
-e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
-e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \
-e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
-e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \
-e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
-e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
-e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
@ -3163,13 +3245,20 @@ unistd.h: unistd.in.h
-e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
-e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
-e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
-e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
-e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
-e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
-e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
-e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \
-e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \
-e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
-e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \
-e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
-e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
-e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
-e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
-e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
-e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
-e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
-e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
@ -3178,8 +3267,12 @@ unistd.h: unistd.in.h
-e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
-e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
-e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
-e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
-e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
-e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
-e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
-e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
-e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
@ -3188,16 +3281,18 @@ unistd.h: unistd.in.h
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
-e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
-e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
-e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
-e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/unistd.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += unistd.h unistd.h-t
@ -3389,7 +3484,7 @@ BUILT_SOURCES += $(WCHAR_H)
# We need the following in order to create <wchar.h> when the system
# version does not work standalone.
wchar.h: wchar.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@ -3432,7 +3527,7 @@ wchar.h: wchar.in.h
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/wchar.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += wchar.h wchar.h-t
@ -3456,7 +3551,7 @@ BUILT_SOURCES += $(WCTYPE_H)
# We need the following in order to create <wctype.h> when the system
# doesn't have one that works with the given compiler.
wctype.h: wctype.in.h
rm -f $@-t $@
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@ -3466,7 +3561,7 @@ wctype.h: wctype.in.h
-e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
-e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
< $(srcdir)/wctype.in.h; \
} > $@-t
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += wctype.h wctype.h-t

View File

@ -0,0 +1,30 @@
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
%struct-type
%language=ANSI-C
%define slot-name standard_name
%define hash-function-name mapping_hash
%define lookup-function-name mapping_lookup
%readonly-tables
%global-table
%define word-array-name mappings
%pic
%%
# On Solaris 10, look in the "iconv -l" output. Some aliases are advertised but
# not actually supported by the iconv() function and by the 'iconv' program.
# For example:
# $ echo abc | iconv -f 646 -t ISO-8859-1
# Not supported 646 to ISO-8859-1
# $ echo abc | iconv -f 646 -t ISO8859-1
$ abc
ASCII, "646"
ISO-8859-1, "ISO8859-1"
ISO-8859-2, "ISO8859-2"
ISO-8859-3, "ISO8859-3"
ISO-8859-4, "ISO8859-4"
ISO-8859-5, "ISO8859-5"
ISO-8859-6, "ISO8859-6"
ISO-8859-7, "ISO8859-7"
ISO-8859-8, "ISO8859-8"
ISO-8859-9, "ISO8859-9"
ISO-8859-15, "ISO8859-15"
CP1251, "ansi-1251"

View File

@ -0,0 +1,190 @@
/* ANSI-C code produced by gperf version 3.0.3 */
/* Command-line: gperf -m 10 ./iconv_open-solaris.gperf */
/* Computed positions: -k'10' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
#line 1 "./iconv_open-solaris.gperf"
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
#define TOTAL_KEYWORDS 13
#define MIN_WORD_LENGTH 5
#define MAX_WORD_LENGTH 11
#define MIN_HASH_VALUE 5
#define MAX_HASH_VALUE 19
/* maximum key range = 15, duplicates = 0 */
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static unsigned int
mapping_hash (register const char *str, register unsigned int len)
{
static const unsigned char asso_values[] =
{
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 0,
9, 8, 7, 6, 5, 4, 3, 2, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20
};
register int hval = len;
switch (hval)
{
default:
hval += asso_values[(unsigned char)str[9]];
/*FALLTHROUGH*/
case 9:
case 8:
case 7:
case 6:
case 5:
break;
}
return hval;
}
struct stringpool_t
{
char stringpool_str5[sizeof("ASCII")];
char stringpool_str6[sizeof("CP1251")];
char stringpool_str7[sizeof("$ abc")];
char stringpool_str10[sizeof("ISO-8859-1")];
char stringpool_str11[sizeof("ISO-8859-15")];
char stringpool_str12[sizeof("ISO-8859-9")];
char stringpool_str13[sizeof("ISO-8859-8")];
char stringpool_str14[sizeof("ISO-8859-7")];
char stringpool_str15[sizeof("ISO-8859-6")];
char stringpool_str16[sizeof("ISO-8859-5")];
char stringpool_str17[sizeof("ISO-8859-4")];
char stringpool_str18[sizeof("ISO-8859-3")];
char stringpool_str19[sizeof("ISO-8859-2")];
};
static const struct stringpool_t stringpool_contents =
{
"ASCII",
"CP1251",
"$ abc",
"ISO-8859-1",
"ISO-8859-15",
"ISO-8859-9",
"ISO-8859-8",
"ISO-8859-7",
"ISO-8859-6",
"ISO-8859-5",
"ISO-8859-4",
"ISO-8859-3",
"ISO-8859-2"
};
#define stringpool ((const char *) &stringpool_contents)
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1},
#line 19 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "646"},
#line 30 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "ansi-1251"},
#line 18 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7},
{-1}, {-1},
#line 20 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-1"},
#line 29 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
#line 28 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-9"},
#line 27 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-8"},
#line 26 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"},
#line 25 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-6"},
#line 24 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "ISO8859-5"},
#line 23 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-4"},
#line 22 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-3"},
#line 21 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-2"}
};
#ifdef __GNUC__
__inline
#ifdef __GNUC_STDC_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
const struct mapping *
mapping_lookup (register const char *str, register unsigned int len)
{
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = mapping_hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register int o = mappings[key].standard_name;
if (o >= 0)
{
register const char *s = o + stringpool;
if (*str == *s && !strcmp (str + 1, s + 1))
return &mappings[key];
}
}
}
return 0;
}

View File

@ -2,7 +2,7 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
#line 1
/* Character set conversion.
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 2007, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -39,6 +39,7 @@
#define ICONV_FLAVOR_HPUX "iconv_open-hpux.h"
#define ICONV_FLAVOR_IRIX "iconv_open-irix.h"
#define ICONV_FLAVOR_OSF "iconv_open-osf.h"
#define ICONV_FLAVOR_SOLARIS "iconv_open-solaris.h"
#ifdef ICONV_FLAVOR
# include ICONV_FLAVOR

View File

@ -1,6 +1,6 @@
/* ignore a value to quiet a compiler warning
/* ignore a function return without a compiler warning
Copyright (C) 2008 Free Software Foundation, Inc.
Copyright (C) 2008-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -17,13 +17,7 @@
/* Written by Jim Meyering. */
#ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
# define __attribute__(x)
# endif
#endif
/* Use this function to avoid a warning when using a function declared with
/* Use these functions to avoid a warning when using a function declared with
gcc's warn_unused_result attribute, but for which you really do want to
ignore the result. Traditionally, people have used a "(void)" cast to
indicate that a function's return value is deliberately unused. However,
@ -38,8 +32,6 @@
"copy.c:233: warning: ignoring return value of 'fchown',
declared with attribute warn_unused_result". */
static inline void
ignore_value (int i __attribute__ ((__unused__)))
{
/* empty */
}
static inline void ignore_value (int i) { (void) i; }
static inline void ignore_ptr (void* p) { (void) p; }
/* FIXME: what about aggregate types? */

View File

@ -3,7 +3,7 @@
#line 1
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -45,10 +45,6 @@
#include <string.h>
#include <errno.h>
#ifndef EAFNOSUPPORT
# define EAFNOSUPPORT EINVAL
#endif
#define NS_IN6ADDRSZ 16
#define NS_INT16SZ 2

View File

@ -1,7 +1,7 @@
/* Provide a stub lchown function for systems that lack it.
Copyright (C) 1998, 1999, 2002, 2004, 2006, 2007 Free Software
Foundation, Inc.
Copyright (C) 1998, 1999, 2002, 2004, 2006, 2007, 2009 Free
Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -30,16 +30,6 @@
#include <errno.h>
#include <sys/stat.h>
/* Some systems don't have EOPNOTSUPP. */
#ifndef EOPNOTSUPP
# ifdef ENOTSUP
# define EOPNOTSUPP ENOTSUP
# else
/* Some systems don't have ENOTSUP either. */
# define EOPNOTSUPP EINVAL
# endif
#endif
/* Work just like chown, except when FILE is a symbolic link.
In that case, set errno to EOPNOTSUPP and return -1.
But if autoconf tests determined that chown modifies
@ -48,7 +38,8 @@
int
lchown (const char *file, uid_t uid, gid_t gid)
{
#if ! CHOWN_MODIFIES_SYMLINK
#if HAVE_CHOWN
# if ! CHOWN_MODIFIES_SYMLINK
struct stat stats;
if (lstat (file, &stats) == 0 && S_ISLNK (stats.st_mode))
@ -56,7 +47,12 @@ lchown (const char *file, uid_t uid, gid_t gid)
errno = EOPNOTSUPP;
return -1;
}
#endif
# endif
return chown (file, uid, gid);
#else /* !HAVE_CHOWN */
errno = ENOSYS;
return -1;
#endif
}

View File

@ -0,0 +1,204 @@
/* -*- buffer-read-only: t -*- vi: set ro: */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
#line 1
/* Emulate link on platforms that lack it, namely native Windows platforms.
Copyright (C) 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <config.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#if !HAVE_LINK
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
/* CreateHardLink was introduced only in Windows 2000. */
typedef BOOL (WINAPI * CreateHardLinkFuncType) (LPCTSTR lpFileName,
LPCTSTR lpExistingFileName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes);
static CreateHardLinkFuncType CreateHardLinkFunc = NULL;
static BOOL initialized = FALSE;
static void
initialize (void)
{
HMODULE kernel32 = LoadLibrary ("kernel32.dll");
if (kernel32 != NULL)
{
CreateHardLinkFunc =
(CreateHardLinkFuncType) GetProcAddress (kernel32, "CreateHardLinkA");
}
initialized = TRUE;
}
int
link (const char *file1, const char *file2)
{
char *dir;
size_t len1 = strlen (file1);
size_t len2 = strlen (file2);
if (!initialized)
initialize ();
if (CreateHardLinkFunc == NULL)
{
/* System does not support hard links. */
errno = EPERM;
return -1;
}
/* Reject trailing slashes on non-directories; mingw does not
support hard-linking directories. */
if ((len1 && (file1[len1 - 1] == '/' || file1[len1 - 1] == '\\'))
|| (len2 && (file2[len2 - 1] == '/' || file2[len2 - 1] == '\\')))
{
struct stat st;
if (stat (file1, &st) == 0 && S_ISDIR (st.st_mode))
errno = EPERM;
else
errno = ENOTDIR;
return -1;
}
/* CreateHardLink("b/.","a",NULL) creates file "b", so we must check
that dirname(file2) exists. */
dir = strdup (file2);
if (!dir)
return -1;
{
struct stat st;
char *p = strchr (dir, '\0');
while (dir < p && (*--p != '/' && *p != '\\'));
*p = '\0';
if (p != dir && stat (dir, &st) == -1)
{
int saved_errno = errno;
free (dir);
errno = saved_errno;
return -1;
}
free (dir);
}
/* Now create the link. */
if (CreateHardLinkFunc (file2, file1, NULL) == 0)
{
/* It is not documented which errors CreateHardLink() can produce.
* The following conversions are based on tests on a Windows XP SP2
* system. */
DWORD err = GetLastError ();
switch (err)
{
case ERROR_ACCESS_DENIED:
errno = EACCES;
break;
case ERROR_INVALID_FUNCTION: /* fs does not support hard links */
errno = EPERM;
break;
case ERROR_NOT_SAME_DEVICE:
errno = EXDEV;
break;
case ERROR_PATH_NOT_FOUND:
case ERROR_FILE_NOT_FOUND:
errno = ENOENT;
break;
case ERROR_INVALID_PARAMETER:
errno = ENAMETOOLONG;
break;
case ERROR_TOO_MANY_LINKS:
errno = EMLINK;
break;
case ERROR_ALREADY_EXISTS:
errno = EEXIST;
break;
default:
errno = EIO;
}
return -1;
}
return 0;
}
# else /* !Windows */
# error "This platform lacks a link function, and Gnulib doesn't provide a replacement. This is a bug in Gnulib."
# endif /* !Windows */
#else /* HAVE_LINK */
# undef link
/* Create a hard link from FILE1 to FILE2, working around platform bugs. */
int
rpl_link (char const *file1, char const *file2)
{
/* Reject trailing slashes on non-directories. */
size_t len1 = strlen (file1);
size_t len2 = strlen (file2);
if ((len1 && file1[len1 - 1] == '/')
|| (len2 && file2[len2 - 1] == '/'))
{
/* Let link() decide whether hard-linking directories is legal.
If stat() fails, link() will probably fail for the same
reason; so we only have to worry about successful stat() and
non-directory. */
struct stat st;
if (stat (file1, &st) == 0 && !S_ISDIR (st.st_mode))
{
errno = ENOTDIR;
return -1;
}
}
else
{
/* Fix Cygwin 1.5.x bug where link("a","b/.") creates file "b". */
char *dir = strdup (file2);
struct stat st;
char *p;
if (!dir)
return -1;
/* We already know file2 does not end in slash. Strip off the
basename, then check that the dirname exists. */
p = strrchr (dir, '/');
if (p)
{
*p = '\0';
if (stat (dir, &st) == -1)
{
int saved_errno = errno;
free (dir);
errno = saved_errno;
return -1;
}
}
free (dir);
}
return link (file1, file2);
}
#endif /* HAVE_LINK */

View File

@ -219,7 +219,7 @@ mbsalign (const char *src, char *dest, size_t dest_size,
dest = mbs_align_pad (dest, dest_end, start_spaces);
dest = mempcpy(dest, str_to_print, MIN (n_used_bytes, dest_end - dest));
dest = mbs_align_pad (dest, dest_end, end_spaces);
mbs_align_pad (dest, dest_end, end_spaces);
}
mbsalign_cleanup:
@ -229,8 +229,3 @@ mbsalign_cleanup:
return ret;
}
/*
* Local variables:
* indent-tabs-mode: nil
* End:
*/

View File

@ -40,7 +40,7 @@
size_t
memxfrm (char *restrict dest, size_t destsize,
char *restrict src, size_t srcsize)
char *restrict src, size_t srcsize)
{
#if HAVE_STRXFRM
@ -59,33 +59,33 @@ memxfrm (char *restrict dest, size_t destsize,
errno = 0;
result += strxfrm (dest + di, src + si, destsize - di) + 1;
if (errno != 0)
break;
break;
if (result <= result0)
{
errno = ERANGE;
break;
}
{
errno = ERANGE;
break;
}
if (result == destsize + 1 && si + slen == srcsize)
{
/* The destination is exactly the right size, but strxfrm wants
room for a trailing null. Work around the problem with a
temporary buffer. */
size_t bufsize = destsize - di + 1;
char stackbuf[4000];
char *buf = stackbuf;
if (sizeof stackbuf < bufsize)
{
buf = malloc (bufsize);
if (! buf)
break;
}
strxfrm (buf, src + si, bufsize);
memcpy (dest + di, buf, destsize - di);
if (sizeof stackbuf < bufsize)
free (buf);
errno = 0;
}
{
/* The destination is exactly the right size, but strxfrm wants
room for a trailing null. Work around the problem with a
temporary buffer. */
size_t bufsize = destsize - di + 1;
char stackbuf[4000];
char *buf = stackbuf;
if (sizeof stackbuf < bufsize)
{
buf = malloc (bufsize);
if (! buf)
break;
}
strxfrm (buf, src + si, bufsize);
memcpy (dest + di, buf, destsize - di);
if (sizeof stackbuf < bufsize)
free (buf);
errno = 0;
}
di = (result < destsize ? result : destsize);
si += slen + 1;

View File

@ -76,45 +76,45 @@ mgetgroups (char const *username, gid_t gid, GETGROUPS_T **groups)
g = realloc_groupbuf (NULL, max_n_groups);
if (g == NULL)
return -1;
return -1;
while (1)
{
GETGROUPS_T *h;
int last_n_groups = max_n_groups;
{
GETGROUPS_T *h;
int last_n_groups = max_n_groups;
/* getgrouplist updates max_n_groups to num required. */
ng = getgrouplist (username, gid, g, &max_n_groups);
/* getgrouplist updates max_n_groups to num required. */
ng = getgrouplist (username, gid, g, &max_n_groups);
/* Some systems (like Darwin) have a bug where they
never increase max_n_groups. */
if (ng < 0 && last_n_groups == max_n_groups)
max_n_groups *= 2;
/* Some systems (like Darwin) have a bug where they
never increase max_n_groups. */
if (ng < 0 && last_n_groups == max_n_groups)
max_n_groups *= 2;
if ((h = realloc_groupbuf (g, max_n_groups)) == NULL)
{
int saved_errno = errno;
free (g);
errno = saved_errno;
return -1;
}
g = h;
if ((h = realloc_groupbuf (g, max_n_groups)) == NULL)
{
int saved_errno = errno;
free (g);
errno = saved_errno;
return -1;
}
g = h;
if (0 <= ng)
{
*groups = g;
/* On success some systems just return 0 from getgrouplist,
so return max_n_groups rather than ng. */
return max_n_groups;
}
}
if (0 <= ng)
{
*groups = g;
/* On success some systems just return 0 from getgrouplist,
so return max_n_groups rather than ng. */
return max_n_groups;
}
}
}
/* else no username, so fall through and use getgroups. */
#endif
max_n_groups = (username
? getugroups (0, NULL, username, gid)
: getgroups (0, NULL));
? getugroups (0, NULL, username, gid)
: getgroups (0, NULL));
/* If we failed to count groups with NULL for a buffer,
try again with a non-NULL one, just in case. */
@ -126,8 +126,8 @@ mgetgroups (char const *username, gid_t gid, GETGROUPS_T **groups)
return -1;
ng = (username
? getugroups (max_n_groups, g, username, gid)
: getgroups (max_n_groups, g));
? getugroups (max_n_groups, g, username, gid)
: getgroups (max_n_groups, g));
if (ng < 0)
{

View File

@ -1,5 +1,5 @@
/* fd-relative mkdir
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -18,13 +18,12 @@
#include <config.h>
#include "openat.h"
#include <unistd.h>
#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#include "save-cwd.h"
#include "openat.h"
#include "openat-priv.h"
#include "save-cwd.h"
/* Solaris 10 has no function like this.
Create a subdirectory, FILE, with mode MODE, in the directory
@ -35,8 +34,6 @@
#define AT_FUNC_NAME mkdirat
#define AT_FUNC_F1 mkdir
#define AT_FUNC_F2 mkdir
#define AT_FUNC_USE_F1_COND 1
#define AT_FUNC_POST_FILE_PARAM_DECLS , mode_t mode
#define AT_FUNC_POST_FILE_ARGS , mode
#include "at-func.c"

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998, 1999, 2001, 2005, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 1998, 1999, 2001, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
This file is derived from the one in the GNU C Library.
This program is free software: you can redistribute it and/or modify
@ -40,5 +40,5 @@ int
mkstemp (template)
char *template;
{
return __gen_tempname (template, __GT_FILE);
return __gen_tempname (template, 0, __GT_FILE);
}

View File

@ -38,6 +38,11 @@ orig_open (const char *filename, int flags, mode_t mode)
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#ifndef REPLACE_OPEN_DIRECTORY
# define REPLACE_OPEN_DIRECTORY 0
#endif
int
open (const char *filename, int flags, ...)
@ -98,6 +103,29 @@ open (const char *filename, int flags, ...)
fd = orig_open (filename, flags, mode);
#if REPLACE_FCHDIR
/* Implementing fchdir and fdopendir requires the ability to open a
directory file descriptor. If open doesn't support that (as on
mingw), we use a dummy file that behaves the same as directories
on Linux (ie. always reports EOF on attempts to read()), and
override fstat() in fchdir.c to hide the fact that we have a
dummy. */
if (REPLACE_OPEN_DIRECTORY && fd < 0 && errno == EACCES
&& (mode & O_ACCMODE) == O_RDONLY)
{
struct stat statbuf;
if (stat (filename, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
{
/* Maximum recursion depth of 1. */
fd = open ("/dev/null", flags, mode);
if (0 <= fd)
fd = _gl_register_fd (fd, filename);
}
else
errno = EACCES;
}
#endif
#if OPEN_TRAILING_SLASH_BUG
/* If the filename ends in a slash and fd does not refer to a directory,
then fail.
@ -128,9 +156,9 @@ open (const char *filename, int flags, ...)
}
#endif
#ifdef FCHDIR_REPLACEMENT
if (fd >= 0)
_gl_register_fd (fd, filename);
#if REPLACE_FCHDIR
if (!REPLACE_OPEN_DIRECTORY && 0 <= fd)
fd = _gl_register_fd (fd, filename);
#endif
return fd;

View File

@ -1,6 +1,6 @@
/* Internals for openat-like functions.
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -23,26 +23,6 @@
#define OPENAT_BUFFER_SIZE 512
char *openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file);
/* Some systems don't have ENOSYS. */
#ifndef ENOSYS
# ifdef ENOTSUP
# define ENOSYS ENOTSUP
# else
/* Some systems don't have ENOTSUP either. */
# define ENOSYS EINVAL
# endif
#endif
/* Some systems don't have EOPNOTSUPP. */
#ifndef EOPNOTSUPP
# ifdef ENOTSUP
# define EOPNOTSUPP ENOTSUP
# else
/* Some systems don't have ENOTSUP either. */
# define EOPNOTSUPP EINVAL
# endif
#endif
/* Trying to access a BUILD_PROC_NAME file will fail on systems without
/proc support, and even on systems *with* ProcFS support. Return
nonzero if the failure may be legitimate, e.g., because /proc is not

View File

@ -1,6 +1,6 @@
/* Create /proc/self/fd-related names for subfiles of open directories.
Copyright (C) 2006 Free Software Foundation, Inc.
Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -34,7 +34,10 @@
#include "xalloc.h"
/* The results of open() in this file are not used with fchdir,
therefore save some unnecessary work in fchdir.c. */
and we do not leak fds to any single-threaded code that could use stdio,
therefore save some unnecessary work in fchdir.c.
FIXME - if the kernel ever adds support for multi-thread safety for
avoiding standard fds, then we should use open_safer. */
#undef open
#undef close
@ -54,6 +57,13 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
{
static int proc_status = 0;
/* Make sure the caller gets ENOENT when appropriate. */
if (!*file)
{
buf[0] = '\0';
return buf;
}
if (! proc_status)
{
/* Set PROC_STATUS to a positive value if /proc/self/fd is

View File

@ -0,0 +1,46 @@
/* Invoke openat, but avoid some glitches.
Copyright (C) 2005, 2006, 2008-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert for open, ported by Eric Blake for openat. */
#include <config.h>
#include "fcntl-safer.h"
#include <fcntl.h>
#include <stdarg.h>
#include "unistd-safer.h"
int
openat_safer (int fd, char const *file, int flags, ...)
{
mode_t mode = 0;
if (flags & O_CREAT)
{
va_list ap;
va_start (ap, flags);
/* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
creates crashing code when 'mode_t' is smaller than 'int'. */
mode = va_arg (ap, PROMOTED_MODE_T);
va_end (ap);
}
return fd_safer (openat (fd, file, flags, mode));
}

View File

@ -25,10 +25,16 @@
#include <sys/stat.h>
#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#include "fcntl--.h"
#include "openat-priv.h"
#include "save-cwd.h"
/* We can't use "fcntl--.h", so that openat_safer does not interfere. */
#if GNULIB_FCNTL_SAFER
# include "fcntl-safer.h"
# undef open
# define open open_safer
#endif
/* Replacement for Solaris' openat function.
<http://www.google.com/search?q=openat+site:docs.sun.com>
First, try to simulate it via open ("/proc/self/fd/FD/FILE").
@ -152,74 +158,6 @@ openat_needs_fchdir (void)
return needs_fchdir;
}
#if !HAVE_FDOPENDIR
/* Replacement for Solaris' function by the same name.
<http://www.google.com/search?q=fdopendir+site:docs.sun.com>
First, try to simulate it via opendir ("/proc/self/fd/FD"). Failing
that, simulate it by doing save_cwd/fchdir/opendir(".")/restore_cwd.
If either the save_cwd or the restore_cwd fails (relatively unlikely),
then give a diagnostic and exit nonzero.
Otherwise, this function works just like Solaris' fdopendir.
W A R N I N G:
Unlike the other fd-related functions here, this one
effectively consumes its FD parameter. The caller should not
close or otherwise manipulate FD if this function returns successfully. */
DIR *
fdopendir (int fd)
{
struct saved_cwd saved_cwd;
int saved_errno;
DIR *dir;
char buf[OPENAT_BUFFER_SIZE];
char *proc_file = openat_proc_name (buf, fd, ".");
if (proc_file)
{
dir = opendir (proc_file);
saved_errno = errno;
}
else
{
dir = NULL;
saved_errno = EOPNOTSUPP;
}
/* If the syscall fails with an expected errno value, resort to
save_cwd/restore_cwd. */
if (! dir && EXPECTED_ERRNO (saved_errno))
{
if (save_cwd (&saved_cwd) != 0)
openat_save_fail (errno);
if (fchdir (fd) != 0)
{
dir = NULL;
saved_errno = errno;
}
else
{
dir = opendir (".");
saved_errno = errno;
if (restore_cwd (&saved_cwd) != 0)
openat_restore_fail (errno);
}
free_cwd (&saved_cwd);
}
if (dir)
close (fd);
if (proc_file != buf)
free (proc_file);
errno = saved_errno;
return dir;
}
#endif
/* Replacement for Solaris' function by the same name.
<http://www.google.com/search?q=fstatat+site:docs.sun.com>
First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE").
@ -231,7 +169,7 @@ fdopendir (int fd)
#define AT_FUNC_NAME fstatat
#define AT_FUNC_F1 lstat
#define AT_FUNC_F2 stat
#define AT_FUNC_USE_F1_COND flag == AT_SYMLINK_NOFOLLOW
#define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
#define AT_FUNC_POST_FILE_PARAM_DECLS , struct stat *st, int flag
#define AT_FUNC_POST_FILE_ARGS , st
#include "at-func.c"
@ -253,7 +191,7 @@ fdopendir (int fd)
#define AT_FUNC_NAME unlinkat
#define AT_FUNC_F1 rmdir
#define AT_FUNC_F2 unlink
#define AT_FUNC_USE_F1_COND flag == AT_REMOVEDIR
#define AT_FUNC_USE_F1_COND AT_REMOVEDIR
#define AT_FUNC_POST_FILE_PARAM_DECLS , int flag
#define AT_FUNC_POST_FILE_ARGS /* empty */
#include "at-func.c"

View File

@ -1,5 +1,5 @@
/* provide a replacement openat function
Copyright (C) 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
Copyright (C) 2004-2006, 2008-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -16,6 +16,9 @@
/* written by Jim Meyering */
#ifndef _GL_HEADER_OPENAT
#define _GL_HEADER_OPENAT
#include <fcntl.h>
#include <sys/types.h>
@ -34,46 +37,10 @@
# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
#endif
/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
value exceeds INT_MAX, so its use as an int doesn't conform to the
C standard, and GCC and Sun C complain in some cases. If the bug
is present, undef AT_FDCWD here, so it can be redefined below. */
#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
# undef AT_FDCWD
#endif
#if !HAVE_OPENAT
/* Use the same bit pattern as Solaris 9, but with the proper
signedness. The bit pattern is important, in case this actually is
Solaris with the above workaround. */
#ifndef AT_FDCWD
# define AT_FDCWD (-3041965)
#endif
/* Use the same values as Solaris 9. This shouldn't matter, but
there's no real reason to differ. */
#ifndef AT_SYMLINK_NOFOLLOW
# define AT_SYMLINK_NOFOLLOW 4096
# define AT_REMOVEDIR 1
#endif
#ifdef __OPENAT_PREFIX
# undef openat
# define __OPENAT_CONCAT(x, y) x ## y
# define __OPENAT_XCONCAT(x, y) __OPENAT_CONCAT (x, y)
# define __OPENAT_ID(y) __OPENAT_XCONCAT (__OPENAT_PREFIX, y)
# define openat __OPENAT_ID (openat)
int openat (int fd, char const *file, int flags, /* mode_t mode */ ...);
int openat_permissive (int fd, char const *file, int flags, mode_t mode,
int *cwd_errno);
# if ! HAVE_FDOPENDIR
# define fdopendir __OPENAT_ID (fdopendir)
# endif
DIR *fdopendir (int fd);
# define fstatat __OPENAT_ID (fstatat)
int fstatat (int fd, char const *file, struct stat *st, int flag);
# define unlinkat __OPENAT_ID (unlinkat)
int unlinkat (int fd, char const *file, int flag);
bool openat_needs_fchdir (void);
#else
@ -84,19 +51,8 @@ bool openat_needs_fchdir (void);
#endif
#if HAVE_OPENAT && ! LSTAT_FOLLOWS_SLASHED_SYMLINK
int rpl_fstatat (int fd, char const *file, struct stat *st, int flag);
# if !COMPILING_FSTATAT
# undef fstatat
# define fstatat rpl_fstatat
# endif
#endif
int mkdirat (int fd, char const *file, mode_t mode);
void openat_restore_fail (int) ATTRIBUTE_NORETURN;
void openat_save_fail (int) ATTRIBUTE_NORETURN;
int fchmodat (int fd, char const *file, mode_t mode, int flag);
int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag);
/* Using these function names makes application code
slightly more readable than it would be with
@ -124,3 +80,35 @@ lchmodat (int fd, char const *file, mode_t mode)
{
return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
}
static inline int
statat (int fd, char const *name, struct stat *st)
{
return fstatat (fd, name, st, 0);
}
static inline int
lstatat (int fd, char const *name, struct stat *st)
{
return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
}
#if GNULIB_FACCESSAT
/* For now, there are no wrappers named laccessat or leuidaccessat,
since gnulib doesn't support faccessat(,AT_SYMLINK_NOFOLLOW) and
since access rights on symlinks are of limited utility. */
static inline int
accessat (int fd, char const *file, int mode)
{
return faccessat (fd, file, mode, 0);
}
static inline int
euidaccessat (int fd, char const *file, int mode)
{
return faccessat (fd, file, mode, AT_EACCESS);
}
#endif
#endif /* _GL_HEADER_OPENAT */

View File

@ -0,0 +1,68 @@
/* Invoke opendir, but avoid some glitches.
Copyright (C) 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Eric Blake. */
#include <config.h>
#include "dirent-safer.h"
#include <errno.h>
#include <unistd.h>
#include "unistd-safer.h"
/* Like opendir, but do not clobber stdin, stdout, or stderr. */
DIR *
opendir_safer (char const *name)
{
DIR *dp = opendir (name);
if (dp)
{
int fd = dirfd (dp);
if (0 <= fd && fd <= STDERR_FILENO)
{
/* If fdopendir is native (as on Linux), then it is safe to
assume dirfd(fdopendir(n))==n. If we are using the
gnulib module fdopendir, then this guarantee is not met,
but fdopendir recursively calls opendir_safer up to 3
times to at least get a safe fd. If fdopendir is not
present but dirfd is accurate (as on cygwin 1.5.x), then
we recurse up to 3 times ourselves. Finally, if dirfd
always fails (as on mingw), then we are already safe. */
DIR *newdp;
int e;
#if HAVE_FDOPENDIR || GNULIB_FDOPENDIR
int f = dup_safer (fd);
newdp = fdopendir (f);
e = errno;
if (! newdp)
close (f);
#else /* !FDOPENDIR */
newdp = opendir_safer (name);
e = errno;
#endif
closedir (dp);
errno = e;
dp = newdp;
}
}
return dp;
}

View File

@ -22,6 +22,7 @@
#undef ENABLE_RELOCATABLE /* avoid defining set_program_name as a macro */
#include "progname.h"
#include <errno.h> /* get program_invocation_name declaration */
#include <string.h>
@ -60,4 +61,11 @@ set_program_name (const char *argv0)
*/
program_name = argv0;
/* On glibc systems, when the gnulib module 'error' is not used, the error()
function comes from libc and uses the variable program_invocation_name,
not program_name. So set this variable as well. */
#if HAVE_DECL_PROGRAM_INVOCATION_NAME
program_invocation_name = (char *) argv0;
#endif
}

View File

@ -54,6 +54,12 @@ struct quoting_options
/* Quote the characters indicated by this bit vector even if the
quoting style would not normally require them to be quoted. */
unsigned int quote_these_too[(UCHAR_MAX / INT_BITS) + 1];
/* The left quote for custom_quoting_style. */
char const *left_quote;
/* The right quote for custom_quoting_style. */
char const *right_quote;
};
/* Names of quoting styles. */
@ -146,6 +152,19 @@ set_quoting_flags (struct quoting_options *o, int i)
return r;
}
void
set_custom_quoting (struct quoting_options *o,
char const *left_quote, char const *right_quote)
{
if (!o)
o = &default_quoting_options;
o->style = custom_quoting_style;
if (!left_quote || !right_quote)
abort ();
o->left_quote = left_quote;
o->right_quote = right_quote;
}
/* Return quoting options for STYLE, with no extra quoting. */
static struct quoting_options
quoting_options_from_style (enum quoting_style style)
@ -185,7 +204,9 @@ static size_t
quotearg_buffer_restyled (char *buffer, size_t buffersize,
char const *arg, size_t argsize,
enum quoting_style quoting_style, int flags,
unsigned int const *quote_these_too)
unsigned int const *quote_these_too,
char const *left_quote,
char const *right_quote)
{
size_t i;
size_t len = 0;
@ -225,34 +246,37 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
case locale_quoting_style:
case clocale_quoting_style:
case custom_quoting_style:
{
/* TRANSLATORS:
Get translations for open and closing quotation marks.
if (quoting_style != custom_quoting_style)
{
/* TRANSLATORS:
Get translations for open and closing quotation marks.
The message catalog should translate "`" to a left
quotation mark suitable for the locale, and similarly for
"'". If the catalog has no translation,
locale_quoting_style quotes `like this', and
clocale_quoting_style quotes "like this".
The message catalog should translate "`" to a left
quotation mark suitable for the locale, and similarly for
"'". If the catalog has no translation,
locale_quoting_style quotes `like this', and
clocale_quoting_style quotes "like this".
For example, an American English Unicode locale should
translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and
should translate "'" to U+201D (RIGHT DOUBLE QUOTATION
MARK). A British English Unicode locale should instead
translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
For example, an American English Unicode locale should
translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and
should translate "'" to U+201D (RIGHT DOUBLE QUOTATION
MARK). A British English Unicode locale should instead
translate these to U+2018 (LEFT SINGLE QUOTATION MARK)
and U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
If you don't know what to put here, please see
<http://en.wikipedia.org/wiki/Quotation_mark#Glyphs>
and use glyphs suitable for your language. */
char const *left = gettext_quote (N_("`"), quoting_style);
char const *right = gettext_quote (N_("'"), quoting_style);
If you don't know what to put here, please see
<http://en.wikipedia.org/wiki/Quotation_mark#Glyphs>
and use glyphs suitable for your language. */
left_quote = gettext_quote (N_("`"), quoting_style);
right_quote = gettext_quote (N_("'"), quoting_style);
}
if (!elide_outer_quotes)
for (quote_string = left; *quote_string; quote_string++)
for (quote_string = left_quote; *quote_string; quote_string++)
STORE (*quote_string);
backslash_escapes = true;
quote_string = right;
quote_string = right_quote;
quote_string_len = strlen (quote_string);
}
break;
@ -280,6 +304,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
{
unsigned char c;
unsigned char esc;
bool is_right_quote = false;
if (backslash_escapes
&& quote_string_len
@ -288,7 +313,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
{
if (elide_outer_quotes)
goto force_outer_quoting_style;
STORE ('\\');
is_right_quote = true;
}
c = arg[i];
@ -300,12 +325,21 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
if (elide_outer_quotes)
goto force_outer_quoting_style;
STORE ('\\');
/* If quote_string were to begin with digits, we'd need to
test for the end of the arg as well. However, it's
hard to imagine any locale that would use digits in
quotes, and set_custom_quoting is documented not to
accept them. */
if (i + 1 < argsize && '0' <= arg[i + 1] && arg[i + 1] <= '9')
{
STORE ('0');
STORE ('0');
}
c = '0';
/* We don't have to worry that this last '0' will be
backslash-escaped because, again, quote_string should
not start with it and because quote_these_too is
documented as not accepting it. */
}
else if (flags & QA_ELIDE_NULL_BYTES)
continue;
@ -425,7 +459,15 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
case 'o': case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y': case 'z':
/* These characters don't cause problems, no matter what the
quoting style is. They cannot start multibyte sequences. */
quoting style is. They cannot start multibyte sequences.
A digit or a special letter would cause trouble if it
appeared at the beginning of quote_string because we'd then
escape by prepending a backslash. However, it's hard to
imagine any locale that would use digits or letters as
quotes, and set_custom_quoting is documented not to accept
them. Also, a digit or a special letter would cause
trouble if it appeared in quote_these_too, but that's also
documented as not accepting them. */
break;
default:
@ -521,6 +563,11 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
STORE ('0' + ((c >> 3) & 7));
c = '0' + (c & 7);
}
else if (is_right_quote)
{
STORE ('\\');
is_right_quote = false;
}
if (ilim <= i + 1)
break;
STORE (c);
@ -534,7 +581,8 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
if (! ((backslash_escapes || elide_outer_quotes)
&& quote_these_too
&& quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
&& quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))
&& !is_right_quote)
goto store_c;
store_escape:
@ -563,7 +611,8 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
sufficiently quotes the specified characters. */
return quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
quoting_style,
flags & ~QA_ELIDE_OUTER_QUOTES, NULL);
flags & ~QA_ELIDE_OUTER_QUOTES, NULL,
left_quote, right_quote);
}
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
@ -583,7 +632,8 @@ quotearg_buffer (char *buffer, size_t buffersize,
struct quoting_options const *p = o ? o : &default_quoting_options;
int e = errno;
size_t r = quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
p->style, p->flags, p->quote_these_too);
p->style, p->flags, p->quote_these_too,
p->left_quote, p->right_quote);
errno = e;
return r;
}
@ -611,10 +661,13 @@ quotearg_alloc_mem (char const *arg, size_t argsize, size_t *size,
/* Elide embedded null bytes if we can't return a size. */
int flags = p->flags | (size ? 0 : QA_ELIDE_NULL_BYTES);
size_t bufsize = quotearg_buffer_restyled (0, 0, arg, argsize, p->style,
flags, p->quote_these_too) + 1;
flags, p->quote_these_too,
p->left_quote,
p->right_quote) + 1;
char *buf = xcharalloc (bufsize);
quotearg_buffer_restyled (buf, bufsize, arg, argsize, p->style, flags,
p->quote_these_too);
p->quote_these_too,
p->left_quote, p->right_quote);
errno = e;
if (size)
*size = bufsize - 1;
@ -703,7 +756,9 @@ quotearg_n_options (int n, char const *arg, size_t argsize,
int flags = options->flags | QA_ELIDE_NULL_BYTES;
size_t qsize = quotearg_buffer_restyled (val, size, arg, argsize,
options->style, flags,
options->quote_these_too);
options->quote_these_too,
options->left_quote,
options->right_quote);
if (size <= qsize)
{
@ -712,7 +767,9 @@ quotearg_n_options (int n, char const *arg, size_t argsize,
free (val);
sv[n].val = val = xcharalloc (size);
quotearg_buffer_restyled (val, size, arg, argsize, options->style,
flags, options->quote_these_too);
flags, options->quote_these_too,
options->left_quote,
options->right_quote);
}
errno = e;
@ -797,3 +854,36 @@ quotearg_colon_mem (char const *arg, size_t argsize)
{
return quotearg_char_mem (arg, argsize, ':');
}
char *
quotearg_n_custom (int n, char const *left_quote,
char const *right_quote, char const *arg)
{
return quotearg_n_custom_mem (n, left_quote, right_quote, arg,
SIZE_MAX);
}
char *
quotearg_n_custom_mem (int n, char const *left_quote,
char const *right_quote,
char const *arg, size_t argsize)
{
struct quoting_options o = default_quoting_options;
set_custom_quoting (&o, left_quote, right_quote);
return quotearg_n_options (n, arg, argsize, &o);
}
char *
quotearg_custom (char const *left_quote, char const *right_quote,
char const *arg)
{
return quotearg_n_custom (0, left_quote, right_quote, arg);
}
char *
quotearg_custom_mem (char const *left_quote, char const *right_quote,
char const *arg, size_t argsize)
{
return quotearg_n_custom_mem (0, left_quote, right_quote, arg,
argsize);
}

View File

@ -100,7 +100,8 @@ enum quoting_style
c_maybe_quoting_style,
/* Like c_quoting_style except always omit the surrounding
double-quote characters (ls --quoting-style=escape).
double-quote characters and ignore QA_SPLIT_TRIGRAPHS
(ls --quoting-style=escape).
quotearg_buffer:
"simple", "\\0 \\t\\n'\"\\033??/\\\\", "a:b"
@ -136,7 +137,8 @@ enum quoting_style
locale_quoting_style,
/* Like c_quoting_style except use quotation marks appropriate for
the locale (ls --quoting-style=clocale).
the locale and ignore QA_SPLIT_TRIGRAPHS
(ls --quoting-style=clocale).
LC_MESSAGES=C
quotearg_buffer:
@ -157,7 +159,50 @@ enum quoting_style
"\302\253simple\302\273",
"\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a\\:b\302\273"
*/
clocale_quoting_style
clocale_quoting_style,
/* Like clocale_quoting_style except use the custom quotation marks
set by set_custom_quoting. If custom quotation marks are not
set, the behavior is undefined.
left_quote = right_quote = "'"
quotearg_buffer:
"'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a:b'"
quotearg:
"'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a:b'"
quotearg_colon:
"'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a\\:b'"
left_quote = "(" and right_quote = ")"
quotearg_buffer:
"(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a:b)"
quotearg:
"(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a:b)"
quotearg_colon:
"(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a\\:b)"
left_quote = ":" and right_quote = " "
quotearg_buffer:
":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a:b "
quotearg:
":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a:b "
quotearg_colon:
":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a\\:b "
left_quote = "\"'" and right_quote = "'\""
Notice that this is treated as a single level of quotes or two
levels where the outer quote need not be escaped within the inner
quotes. For two levels where the outer quote must be escaped
within the inner quotes, you must use separate quotearg
invocations.
quotearg_buffer:
"\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a:b'\""
quotearg:
"\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a:b'\""
quotearg_colon:
"\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a\\:b'\""
*/
custom_quoting_style
};
/* Flags for use in set_quoting_flags. */
@ -210,7 +255,9 @@ void set_quoting_style (struct quoting_options *o, enum quoting_style s);
set the value of the quoting options for character C to I.
Return the old value. Currently, the only values defined for I are
0 (the default) and 1 (which means to quote the character even if
it would not otherwise be quoted). */
it would not otherwise be quoted). C must never be a digit or a
letter that has special meaning after a backslash (for example, "\t"
for tab). */
int set_char_quoting (struct quoting_options *o, char c, int i);
/* In O (or in the default if O is null),
@ -219,6 +266,19 @@ int set_char_quoting (struct quoting_options *o, char c, int i);
behavior. Return the old value. */
int set_quoting_flags (struct quoting_options *o, int i);
/* In O (or in the default if O is null),
set the value of the quoting style to custom_quoting_style,
set the left quote to LEFT_QUOTE, and set the right quote to
RIGHT_QUOTE. Each of LEFT_QUOTE and RIGHT_QUOTE must be
null-terminated and can be the empty string. Because backslashes are
used for escaping, it does not make sense for RIGHT_QUOTE to contain
a backslash. RIGHT_QUOTE must not begin with a digit or a letter
that has special meaning after a backslash (for example, "\t" for
tab). */
void set_custom_quoting (struct quoting_options *o,
char const *left_quote,
char const *right_quote);
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using O to control quoting.
If O is null, use the default.
@ -287,7 +347,8 @@ char *quotearg_style (enum quoting_style s, char const *arg);
char *quotearg_style_mem (enum quoting_style s,
char const *arg, size_t argsize);
/* Like quotearg (ARG), except also quote any instances of CH. */
/* Like quotearg (ARG), except also quote any instances of CH.
See set_char_quoting for a description of acceptable CH values. */
char *quotearg_char (char const *arg, char ch);
/* Like quotearg_char (ARG, CH), except it can quote null bytes. */
@ -299,6 +360,29 @@ char *quotearg_colon (char const *arg);
/* Like quotearg_colon (ARG), except it can quote null bytes. */
char *quotearg_colon_mem (char const *arg, size_t argsize);
/* Like quotearg_n_style (N, S, ARG) but with S as custom_quoting_style
with left quote as LEFT_QUOTE and right quote as RIGHT_QUOTE. See
set_custom_quoting for a description of acceptable LEFT_QUOTE and
RIGHT_QUOTE values. */
char *quotearg_n_custom (int n, char const *left_quote,
char const *right_quote, char const *arg);
/* Like quotearg_n_custom (N, LEFT_QUOTE, RIGHT_QUOTE, ARG) except it
can quote null bytes. */
char *quotearg_n_custom_mem (int n, char const *left_quote,
char const *right_quote,
char const *arg, size_t argsize);
/* Equivalent to quotearg_n_custom (0, LEFT_QUOTE, RIGHT_QUOTE, ARG). */
char *quotearg_custom (char const *left_quote, char const *right_quote,
char const *arg);
/* Equivalent to quotearg_n_custom_mem (0, LEFT_QUOTE, RIGHT_QUOTE, ARG,
ARGSIZE). */
char *quotearg_custom_mem (char const *left_quote,
char const *right_quote,
char const *arg, size_t argsize);
/* Free any dynamically allocated memory. */
void quotearg_free (void);

View File

@ -43,7 +43,7 @@
/* This index operation is more efficient on many processors */
#define ind(mm, x) \
(* (uint32_t *) ((char *) (mm) \
+ ((x) & (ISAAC_WORDS - 1) * sizeof (uint32_t))))
+ ((x) & (ISAAC_WORDS - 1) * sizeof (uint32_t))))
/*
* The central step. This uses two temporaries, x and y. mm is the
@ -191,18 +191,18 @@ isaac_init (struct isaac_state *s, uint32_t const *seed, size_t seedsize)
isaac_mix (s, seed);
/* Second and subsequent passes (extension to ISAAC) */
while (seedsize -= ISAAC_BYTES)
{
seed += ISAAC_WORDS;
for (i = 0; i < ISAAC_WORDS; i++)
s->mm[i] += seed[i];
isaac_mix (s, s->mm);
}
{
seed += ISAAC_WORDS;
for (i = 0; i < ISAAC_WORDS; i++)
s->mm[i] += seed[i];
isaac_mix (s, s->mm);
}
}
else
{
/* The no seed case (as in reference ISAAC code) */
for (i = 0; i < ISAAC_WORDS; i++)
s->mm[i] = 0;
s->mm[i] = 0;
}
/* Final pass */
@ -252,7 +252,7 @@ isaac_seed_data (struct isaac_state *s, void const *buffer, size_t size)
{
p = (unsigned char *) s->mm + s->c;
for (i = 0; i < avail; i++)
p[i] ^= buf[i];
p[i] ^= buf[i];
buf += avail;
size -= avail;
isaac_mix (s, s->mm);

View File

@ -128,75 +128,75 @@ randint_genmax (struct randint_source *s, randint genmax)
for (;;)
{
if (randmax < genmax)
{
/* Calculate how many input bytes will be needed, and read
the bytes. */
{
/* Calculate how many input bytes will be needed, and read
the bytes. */
size_t i = 0;
randint rmax = randmax;
unsigned char buf[sizeof randnum];
size_t i = 0;
randint rmax = randmax;
unsigned char buf[sizeof randnum];
do
{
rmax = shift_left (rmax) + UCHAR_MAX;
i++;
}
while (rmax < genmax);
do
{
rmax = shift_left (rmax) + UCHAR_MAX;
i++;
}
while (rmax < genmax);
randread (source, buf, i);
randread (source, buf, i);
/* Increase RANDMAX by appending random bytes to RANDNUM and
UCHAR_MAX to RANDMAX until RANDMAX is no less than
GENMAX. This may lose up to CHAR_BIT bits of information
if shift_right (RANDINT_MAX) < GENMAX, but it is not
worth the programming hassle of saving these bits since
GENMAX is rarely that large in practice. */
/* Increase RANDMAX by appending random bytes to RANDNUM and
UCHAR_MAX to RANDMAX until RANDMAX is no less than
GENMAX. This may lose up to CHAR_BIT bits of information
if shift_right (RANDINT_MAX) < GENMAX, but it is not
worth the programming hassle of saving these bits since
GENMAX is rarely that large in practice. */
i = 0;
i = 0;
do
{
randnum = shift_left (randnum) + buf[i];
randmax = shift_left (randmax) + UCHAR_MAX;
i++;
}
while (randmax < genmax);
}
do
{
randnum = shift_left (randnum) + buf[i];
randmax = shift_left (randmax) + UCHAR_MAX;
i++;
}
while (randmax < genmax);
}
if (randmax == genmax)
{
s->randnum = s->randmax = 0;
return randnum;
}
{
s->randnum = s->randmax = 0;
return randnum;
}
else
{
/* GENMAX < RANDMAX, so attempt to generate a random number
by taking RANDNUM modulo GENMAX+1. This will choose
fairly so long as RANDNUM falls within an integral
multiple of GENMAX+1; otherwise, LAST_USABLE_CHOICE < RANDNUM,
so discard this attempt and try again.
{
/* GENMAX < RANDMAX, so attempt to generate a random number
by taking RANDNUM modulo GENMAX+1. This will choose
fairly so long as RANDNUM falls within an integral
multiple of GENMAX+1; otherwise, LAST_USABLE_CHOICE < RANDNUM,
so discard this attempt and try again.
Since GENMAX cannot be RANDINT_MAX, CHOICES cannot be
zero and there is no need to worry about dividing by
zero. */
Since GENMAX cannot be RANDINT_MAX, CHOICES cannot be
zero and there is no need to worry about dividing by
zero. */
randint excess_choices = randmax - genmax;
randint unusable_choices = excess_choices % choices;
randint last_usable_choice = randmax - unusable_choices;
randint reduced_randnum = randnum % choices;
randint excess_choices = randmax - genmax;
randint unusable_choices = excess_choices % choices;
randint last_usable_choice = randmax - unusable_choices;
randint reduced_randnum = randnum % choices;
if (randnum <= last_usable_choice)
{
s->randnum = randnum / choices;
s->randmax = excess_choices / choices;
return reduced_randnum;
}
if (randnum <= last_usable_choice)
{
s->randnum = randnum / choices;
s->randmax = excess_choices / choices;
return reduced_randnum;
}
/* Retry, but retain the randomness from the fact that RANDNUM fell
into the range LAST_USABLE_CHOICE+1 .. RANDMAX. */
randnum = reduced_randnum;
randmax = unusable_choices - 1;
}
/* Retry, but retain the randomness from the fact that RANDNUM fell
into the range LAST_USABLE_CHOICE+1 .. RANDMAX. */
randnum = reduced_randnum;
randmax = unusable_choices - 1;
}
}
}

View File

@ -79,21 +79,21 @@ randperm_new (struct randint_source *r, size_t h, size_t n)
default:
{
size_t i;
size_t i;
v = xnmalloc (n, sizeof *v);
for (i = 0; i < n; i++)
v[i] = i;
v = xnmalloc (n, sizeof *v);
for (i = 0; i < n; i++)
v[i] = i;
for (i = 0; i < h; i++)
{
size_t j = i + randint_choose (r, n - i);
size_t t = v[i];
v[i] = v[j];
v[j] = t;
}
for (i = 0; i < h; i++)
{
size_t j = i + randint_choose (r, n - i);
size_t t = v[i];
v[i] = v[j];
v[j] = t;
}
v = xnrealloc (v, h, sizeof *v);
v = xnrealloc (v, h, sizeof *v);
}
break;
}

View File

@ -100,8 +100,8 @@ struct randread_source
/* Up to a buffer's worth of pseudorandom data. */
union
{
uint32_t w[ISAAC_WORDS];
unsigned char b[ISAAC_BYTES];
uint32_t w[ISAAC_WORDS];
unsigned char b[ISAAC_BYTES];
} data;
} isaac;
} buf;
@ -115,8 +115,8 @@ randread_error (void const *file_name)
{
if (file_name)
error (exit_failure, errno,
_(errno == 0 ? "%s: end of file" : "%s: read error"),
quotearg_colon (file_name));
_(errno == 0 ? "%s: end of file" : "%s: read error"),
quotearg_colon (file_name));
abort ();
}
@ -155,18 +155,18 @@ randread_new (char const *name, size_t bytes_bound)
struct randread_source *s;
if (name)
if (! (source = fopen_safer (name, "rb")))
return NULL;
if (! (source = fopen_safer (name, "rb")))
return NULL;
s = simple_new (source, name);
if (source)
setvbuf (source, s->buf.c, _IOFBF, MIN (sizeof s->buf.c, bytes_bound));
setvbuf (source, s->buf.c, _IOFBF, MIN (sizeof s->buf.c, bytes_bound));
else
{
s->buf.isaac.buffered = 0;
isaac_seed (&s->buf.isaac.state);
}
{
s->buf.isaac.buffered = 0;
isaac_seed (&s->buf.isaac.state);
}
return s;
}
@ -206,7 +206,7 @@ readsource (struct randread_source *s, unsigned char *p, size_t size)
p += inbytes;
size -= inbytes;
if (size == 0)
break;
break;
errno = (ferror (s->source) ? fread_errno : 0);
s->handler (s->handler_arg);
}
@ -224,34 +224,34 @@ readisaac (struct isaac *isaac, unsigned char *p, size_t size)
for (;;)
{
if (size <= inbytes)
{
memcpy (p, isaac->data.b + ISAAC_BYTES - inbytes, size);
isaac->buffered = inbytes - size;
return;
}
{
memcpy (p, isaac->data.b + ISAAC_BYTES - inbytes, size);
isaac->buffered = inbytes - size;
return;
}
memcpy (p, isaac->data.b + ISAAC_BYTES - inbytes, inbytes);
p += inbytes;
size -= inbytes;
/* If P is aligned, write to *P directly to avoid the overhead
of copying from the buffer. */
of copying from the buffer. */
if (ALIGNED_POINTER (p, uint32_t))
{
uint32_t *wp = (uint32_t *) p;
while (ISAAC_BYTES <= size)
{
isaac_refill (&isaac->state, wp);
wp += ISAAC_WORDS;
size -= ISAAC_BYTES;
if (size == 0)
{
isaac->buffered = 0;
return;
}
}
p = (unsigned char *) wp;
}
{
uint32_t *wp = (uint32_t *) p;
while (ISAAC_BYTES <= size)
{
isaac_refill (&isaac->state, wp);
wp += ISAAC_WORDS;
size -= ISAAC_BYTES;
if (size == 0)
{
isaac->buffered = 0;
return;
}
}
p = (unsigned char *) wp;
}
isaac_refill (&isaac->state, isaac->data.w);
inbytes = ISAAC_BYTES;

View File

@ -3,7 +3,8 @@
a trailing slash. On mingw, rename fails when the destination
exists.
Copyright (C) 2001, 2002, 2003, 2005, 2006, 2009 Free Software Foundation, Inc.
Copyright (C) 2001, 2002, 2003, 2005, 2006, 2009 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -21,16 +22,20 @@
/* written by Volker Borchert */
#include <config.h>
#include <stdio.h>
#undef rename
#if RENAME_DEST_EXISTS_BUG
/* This replacement must come first, otherwise when cross
* compiling to Windows we will guess that it has the trailing
* slash bug and entirely miss this one. */
#include <errno.h>
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* The mingw rename has problems with trailing slashes; it also
requires use of native Windows calls to allow atomic renames over
existing files. */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
# include <errno.h>
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
/* Rename the file SRC to DST. This replacement is necessary on
Windows, on which the system rename function will not replace
@ -114,10 +119,10 @@ rpl_rename (char const *src, char const *dst)
errno = EPERM; /* ? */
break;
#ifndef ERROR_FILE_TOO_LARGE
# ifndef ERROR_FILE_TOO_LARGE
/* This value is documented but not defined in all versions of windows.h. */
#define ERROR_FILE_TOO_LARGE 223
#endif
# define ERROR_FILE_TOO_LARGE 223
# endif
case ERROR_FILE_TOO_LARGE:
errno = EFBIG;
break;
@ -129,13 +134,18 @@ rpl_rename (char const *src, char const *dst)
return -1;
}
#elif RENAME_TRAILING_SLASH_BUG
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dirname.h"
#include "xalloc.h"
#else /* ! W32 platform */
# if RENAME_DEST_EXISTS_BUG
# error Please report your platform and this message to bug-gnulib@gnu.org.
# elif RENAME_TRAILING_SLASH_BUG
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include "dirname.h"
# include "xalloc.h"
/* Rename the file SRC to DST, removing any trailing
slashes from SRC. Needed for SunOS 4.1.1_U1. */
@ -162,4 +172,5 @@ rpl_rename (char const *src, char const *dst)
return ret_val;
}
#endif /* RENAME_TRAILING_SLASH_BUG */
# endif /* RENAME_TRAILING_SLASH_BUG */
#endif /* ! W32 platform */

View File

@ -34,12 +34,12 @@ get_root_dev_ino (struct dev_ino *root_d_i);
do \
{ \
if (STREQ (Dirname, "/")) \
error (0, 0, _("it is dangerous to operate recursively on %s"), \
quote (Dirname)); \
error (0, 0, _("it is dangerous to operate recursively on %s"), \
quote (Dirname)); \
else \
error (0, 0, \
_("it is dangerous to operate recursively on %s (same as %s)"), \
quote_n (0, Dirname), quote_n (1, "/")); \
error (0, 0, \
_("it is dangerous to operate recursively on %s (same as %s)"), \
quote_n (0, Dirname), quote_n (1, "/")); \
error (0, 0, _("use --no-preserve-root to override this failsafe")); \
} \
while (0)

View File

@ -1,7 +1,7 @@
/* savedir.c -- save the list of files in a directory in a string
Copyright (C) 1990, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -26,7 +26,7 @@
#include <errno.h>
#include <dirent.h>
#include "dirent--.h"
#ifndef _D_EXACT_NAMLEN
# define _D_EXACT_NAMLEN(dp) strlen ((dp)->d_name)
#endif
@ -35,18 +35,12 @@
#include <stdlib.h>
#include <string.h>
#include "openat.h"
#include "xalloc.h"
#ifndef NAME_SIZE_DEFAULT
# define NAME_SIZE_DEFAULT 512
#endif
/* The results of opendir() in this file are not used with dirfd and fchdir,
therefore save some unnecessary work in fchdir.c. */
#undef opendir
#undef closedir
/* Return a freshly allocated string containing the file names
in directory DIRP, separated by '\0' characters;
the end is marked by two '\0' characters in a row.

View File

@ -1,6 +1,6 @@
/* Save and restore the working directory, possibly using a child process.
Copyright (C) 2006, 2007 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -34,10 +34,6 @@
#include "dirname.h"
#include "fcntl-safer.h"
#ifndef ESTALE
# define ESTALE -1
#endif
/* Save the working directory into *WD, if it hasn't been saved
already. Return true if a child has been forked to do the real
work. */

View File

@ -24,6 +24,7 @@
#include <config.h>
#include <alloca.h>
#include <assert.h>
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Native Win32. */
@ -79,6 +80,23 @@ typedef DWORD (WINAPI *PNtQueryInformationFile)
#define PIPE_BUF 512
#endif
#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
static BOOL
IsSocketHandle(HANDLE h)
{
WSANETWORKEVENTS ev;
if (IsConsoleHandle (h))
return FALSE;
/* Under Wine, it seems that getsockopt returns 0 for pipes too.
WSAEnumNetworkEvents instead distinguishes the two correctly. */
ev.lNetworkEvents = 0xDEADBEEF;
WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev);
return ev.lNetworkEvents != 0xDEADBEEF;
}
/* Compute output fd_sets for libc descriptor FD (whose Win32 handle is H). */
static int
@ -141,19 +159,37 @@ win32_poll_handle (HANDLE h, int fd, struct bitset *rbits, struct bitset *wbits,
break;
case FILE_TYPE_CHAR:
ret = WaitForSingleObject (h, 0);
write = TRUE;
if (!(rbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1)))))
break;
ret = WaitForSingleObject (h, 0);
if (ret == WAIT_OBJECT_0)
{
if (!IsConsoleHandle (h))
{
read = TRUE;
break;
}
nbuffer = avail = 0;
bRet = GetNumberOfConsoleInputEvents (h, &nbuffer);
if (!bRet || nbuffer == 0)
except = TRUE;
/* Screen buffers handles are filtered earlier. */
assert (bRet);
if (nbuffer == 0)
{
except = TRUE;
break;
}
irbuffer = (INPUT_RECORD *) alloca (nbuffer * sizeof (INPUT_RECORD));
bRet = PeekConsoleInput (h, irbuffer, nbuffer, &avail);
if (!bRet || avail == 0)
except = TRUE;
{
except = TRUE;
break;
}
for (i = 0; i < avail; i++)
if (irbuffer[i].EventType == KEY_EVENT)
@ -202,7 +238,7 @@ rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
fd_set handle_rfds, handle_wfds, handle_xfds;
struct bitset rbits, wbits, xbits;
unsigned char anyfds_in[FD_SETSIZE / CHAR_BIT];
DWORD ret, wait_timeout, nhandles, nsock;
DWORD ret, wait_timeout, nhandles, nsock, nbuffer;
MSG msg;
int i, fd, rc;
@ -230,7 +266,10 @@ rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
nhandles = 1;
nsock = 0;
/* Copy descriptors to bitsets. */
/* Copy descriptors to bitsets. At the same time, eliminate
bits in the "wrong" direction for console input buffers
and screen buffers, because screen buffers are waitable
and they will block until a character is available. */
memset (&rbits, 0, sizeof (rbits));
memset (&wbits, 0, sizeof (wbits));
memset (&xbits, 0, sizeof (xbits));
@ -239,6 +278,11 @@ rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
for (i = 0; i < rfds->fd_count; i++)
{
fd = rfds->fd_array[i];
h = (HANDLE) _get_osfhandle (fd);
if (IsConsoleHandle (h)
&& !GetNumberOfConsoleInputEvents (h, &nbuffer))
continue;
rbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
}
@ -249,6 +293,11 @@ rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
for (i = 0; i < wfds->fd_count; i++)
{
fd = wfds->fd_array[i];
h = (HANDLE) _get_osfhandle (fd);
if (IsConsoleHandle (h)
&& GetNumberOfConsoleInputEvents (h, &nbuffer))
continue;
wbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
}
@ -288,11 +337,7 @@ rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
return -1;
}
/* Under Wine, it seems that getsockopt returns 0 for pipes too.
WSAEnumNetworkEvents instead distinguishes the two correctly. */
ev.lNetworkEvents = 0xDEADBEEF;
WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev);
if (ev.lNetworkEvents != 0xDEADBEEF)
if (IsSocketHandle (h))
{
int requested = FD_CLOSE;

View File

@ -33,56 +33,40 @@
#define AT_FUNC_NAME getfileconat
#define AT_FUNC_F1 getfilecon
#define AT_FUNC_F2 getfilecon
#define AT_FUNC_USE_F1_COND 1
#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t *con
#define AT_FUNC_POST_FILE_ARGS , con
#include "at-func.c"
#undef AT_FUNC_NAME
#undef AT_FUNC_F1
#undef AT_FUNC_F2
#undef AT_FUNC_USE_F1_COND
#undef AT_FUNC_POST_FILE_PARAM_DECLS
#undef AT_FUNC_POST_FILE_ARGS
#define AT_FUNC_NAME lgetfileconat
#define AT_FUNC_F1 lgetfilecon
#define AT_FUNC_F2 lgetfilecon
#define AT_FUNC_USE_F1_COND 1
#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t *con
#define AT_FUNC_POST_FILE_ARGS , con
#include "at-func.c"
#undef AT_FUNC_NAME
#undef AT_FUNC_F1
#undef AT_FUNC_F2
#undef AT_FUNC_USE_F1_COND
#undef AT_FUNC_POST_FILE_PARAM_DECLS
#undef AT_FUNC_POST_FILE_ARGS
#define AT_FUNC_NAME setfileconat
#define AT_FUNC_F1 setfilecon
#define AT_FUNC_F2 setfilecon
#define AT_FUNC_USE_F1_COND 1
#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t con
#define AT_FUNC_POST_FILE_ARGS , con
#include "at-func.c"
#undef AT_FUNC_NAME
#undef AT_FUNC_F1
#undef AT_FUNC_F2
#undef AT_FUNC_USE_F1_COND
#undef AT_FUNC_POST_FILE_PARAM_DECLS
#undef AT_FUNC_POST_FILE_ARGS
#define AT_FUNC_NAME lsetfileconat
#define AT_FUNC_F1 lsetfilecon
#define AT_FUNC_F2 lsetfilecon
#define AT_FUNC_USE_F1_COND 1
#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t con
#define AT_FUNC_POST_FILE_ARGS , con
#include "at-func.c"
#undef AT_FUNC_NAME
#undef AT_FUNC_F1
#undef AT_FUNC_F2
#undef AT_FUNC_USE_F1_COND
#undef AT_FUNC_POST_FILE_PARAM_DECLS
#undef AT_FUNC_POST_FILE_ARGS

View File

@ -20,33 +20,33 @@
/* These are the dir-fd-relative variants of the functions without the
"at" suffix. For example, getfileconat (AT_FDCWD, file, &c) is usually
equivalent to getfilecon (file, &c). The emulation is accomplished
by first attempting getfilecon ("/proc/self/fd/DIRFD/FILE", &c).
by first attempting getfilecon ("/proc/self/fd/DIR_FD/FILE", &c).
Failing that, simulate it via save_cwd/fchdir/getfilecon/restore_cwd.
If either the save_cwd or the restore_cwd fails (relatively unlikely),
then give a diagnostic and exit nonzero. */
/* dir-fd-relative getfilecon. Set *CON to the SELinux security context
of the file specified by DIRFD and FILE and return the length of *CON.
DIRFD and FILE are interpreted as for fstatat[*]. A non-NULL *CON
of the file specified by DIR_FD and FILE and return the length of *CON.
DIR_FD and FILE are interpreted as for fstatat[*]. A non-NULL *CON
must be freed with freecon. Upon error, set *CON to NULL, set errno
and return -1.
[*] with flags=0 here, with flags=AT_SYMLINK_NOFOLLOW for lgetfileconat */
int getfileconat (int dirfd, char const *file, security_context_t *con);
int getfileconat (int dir_fd, char const *file, security_context_t *con);
/* dir-fd-relative lgetfilecon. This function is just like getfileconat,
except when DIRFD and FILE specify a symlink: lgetfileconat operates on
except when DIR_FD and FILE specify a symlink: lgetfileconat operates on
the symlink, while getfileconat operates on the referent of the symlink. */
int lgetfileconat (int dirfd, char const *file, security_context_t *con);
int lgetfileconat (int dir_fd, char const *file, security_context_t *con);
/* dir-fd-relative setfilecon. Set the SELinux security context of
the file specified by DIRFD and FILE to CON. DIRFD and FILE are
the file specified by DIR_FD and FILE to CON. DIR_FD and FILE are
interpreted as for fstatat[*]. Upon success, return 0.
Otherwise, return -1 and set errno. */
int setfileconat (int dirfd, char const *file, security_context_t con);
int setfileconat (int dir_fd, char const *file, security_context_t con);
/* dir-fd-relative lsetfilecon. This function is just like setfileconat,
except that rather than dereferencing a symlink, this function affects it. */
/* dir-fd-relative lsetfilecon. This function is just like setfileconat,
except when DIRFD and FILE specify a symlink: lsetfileconat operates on
except when DIR_FD and FILE specify a symlink: lsetfileconat operates on
the symlink, while setfileconat operates on the referent of the symlink. */
int lsetfileconat (int dirfd, char const *file, security_context_t con);
int lsetfileconat (int dir_fd, char const *file, security_context_t con);

View File

@ -234,7 +234,7 @@ qset_acl (char const *name, int desc, mode_t mode)
acl_free (aclp);
if (ret < 0)
{
if (saved_errno == ENOSYS)
if (saved_errno == ENOSYS || saved_errno == EOPNOTSUPP)
return chmod_or_fchmod (name, desc, mode);
errno = saved_errno;
return -1;

View File

@ -1,6 +1,6 @@
/* settime -- set the system clock
Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software
Copyright (C) 2002, 2004, 2005, 2006, 2007, 2009 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
@ -27,16 +27,6 @@
#include <errno.h>
/* Some systems don't have ENOSYS. */
#ifndef ENOSYS
# ifdef ENOTSUP
# define ENOSYS ENOTSUP
# else
/* Some systems don't have ENOTSUP either. */
# define ENOSYS EINVAL
# endif
#endif
/* Set the system time. */
int

View File

@ -1,6 +1,6 @@
/* Like stdio.h, but redefine some names to avoid glitches.
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,8 +20,17 @@
#include <stdio.h>
#include "stdio-safer.h"
#undef fopen
#define fopen fopen_safer
#if GNULIB_FOPEN_SAFER
# undef fopen
# define fopen fopen_safer
#endif
#undef tmpfile
#define tmpfile tmpfile_safer
#if GNULIB_TMPFILE_SAFER
# undef tmpfile
# define tmpfile tmpfile_safer
#endif
#if GNULIB_POPEN_SAFER
# undef popen
# define popen popen_safer
#endif

View File

@ -1,6 +1,6 @@
/* Invoke stdio functions, but avoid some glitches.
Copyright (C) 2001, 2003, 2006 Free Software Foundation, Inc.
Copyright (C) 2001, 2003, 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,4 +20,5 @@
#include <stdio.h>
FILE *fopen_safer (char const *, char const *);
FILE *popen_safer (char const *, char const *);
FILE *tmpfile_safer (void);

View File

@ -71,6 +71,70 @@
extern "C" {
#endif
#if @GNULIB_DPRINTF@
# if @REPLACE_DPRINTF@
# define dprintf rpl_dprintf
# endif
# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@
extern int dprintf (int fd, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef dprintf
# define dprintf(d,f,a) \
(GL_LINK_WARNING ("dprintf is unportable - " \
"use gnulib module dprintf for portability"), \
dprintf (d, f, a))
#endif
#if @GNULIB_FCLOSE@
# if @REPLACE_FCLOSE@
# define fclose rpl_fclose
/* Close STREAM and its underlying file descriptor. */
extern int fclose (FILE *stream);
# endif
#elif defined GNULIB_POSIXCHECK
# undef fclose
# define fclose(f) \
(GL_LINK_WARNING ("fclose is not always POSIX compliant - " \
"use gnulib module fclose for portable " \
"POSIX compliance"), \
fclose (f))
#endif
#if @GNULIB_FFLUSH@
# if @REPLACE_FFLUSH@
# define fflush rpl_fflush
/* Flush all pending data on STREAM according to POSIX rules. Both
output and seekable input streams are supported.
Note! LOSS OF DATA can occur if fflush is applied on an input stream
that is _not_seekable_ or on an update stream that is _not_seekable_
and in which the most recent operation was input. Seekability can
be tested with lseek(fileno(fp),0,SEEK_CUR). */
extern int fflush (FILE *gl_stream);
# endif
#elif defined GNULIB_POSIXCHECK
# undef fflush
# define fflush(f) \
(GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
"use gnulib module fflush for portable " \
"POSIX compliance"), \
fflush (f))
#endif
#if @GNULIB_FOPEN@
# if @REPLACE_FOPEN@
# undef fopen
# define fopen rpl_fopen
extern FILE * fopen (const char *filename, const char *mode);
# endif
#elif defined GNULIB_POSIXCHECK
# undef fopen
# define fopen(f,m) \
(GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \
"use gnulib module fopen for portability"), \
fopen (f, m))
#endif
#if @GNULIB_FPRINTF_POSIX@
# if @REPLACE_FPRINTF@
@ -91,215 +155,37 @@ extern int fprintf (FILE *fp, const char *format, ...)
fprintf)
#endif
#if @GNULIB_VFPRINTF_POSIX@
# if @REPLACE_VFPRINTF@
# define vfprintf rpl_vfprintf
extern int vfprintf (FILE *fp, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
#if @GNULIB_FPURGE@
# if @REPLACE_FPURGE@
# define fpurge rpl_fpurge
# endif
#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# define vfprintf rpl_vfprintf
extern int vfprintf (FILE *fp, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
#elif defined GNULIB_POSIXCHECK
# undef vfprintf
# define vfprintf(s,f,a) \
(GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
"use gnulib module vfprintf-posix for portable " \
"POSIX compliance"), \
vfprintf (s, f, a))
#endif
#if @GNULIB_PRINTF_POSIX@
# if @REPLACE_PRINTF@
/* Don't break __attribute__((format(printf,M,N))). */
# define printf __printf__
extern int printf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2)));
# endif
#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
/* Don't break __attribute__((format(printf,M,N))). */
# define printf __printf__
extern int printf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2)));
#elif defined GNULIB_POSIXCHECK
# undef printf
# define printf \
(GL_LINK_WARNING ("printf is not always POSIX compliant - " \
"use gnulib module printf-posix for portable " \
"POSIX compliance"), \
printf)
/* Don't break __attribute__((format(printf,M,N))). */
# define format(kind,m,n) format (__##kind##__, m, n)
# define __format__(kind,m,n) __format__ (__##kind##__, m, n)
# define ____printf____ __printf__
# define ____scanf____ __scanf__
# define ____strftime____ __strftime__
# define ____strfmon____ __strfmon__
#endif
#if @GNULIB_VPRINTF_POSIX@
# if @REPLACE_VPRINTF@
# define vprintf rpl_vprintf
extern int vprintf (const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 1, 0)));
# endif
#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# define vprintf rpl_vprintf
extern int vprintf (const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 1, 0)));
#elif defined GNULIB_POSIXCHECK
# undef vprintf
# define vprintf(f,a) \
(GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
"use gnulib module vprintf-posix for portable " \
"POSIX compliance"), \
vprintf (f, a))
#endif
#if @GNULIB_SNPRINTF@
# if @REPLACE_SNPRINTF@
# define snprintf rpl_snprintf
# endif
# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
extern int snprintf (char *str, size_t size, const char *format, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
# if @REPLACE_FPURGE@ || !@HAVE_DECL_FPURGE@
/* Discard all pending buffered I/O data on STREAM.
STREAM must not be wide-character oriented.
When discarding pending output, the file position is set back to where it
was before the write calls. When discarding pending input, the file
position is advanced to match the end of the previously read input.
Return 0 if successful. Upon error, return -1 and set errno. */
extern int fpurge (FILE *gl_stream);
# endif
#elif defined GNULIB_POSIXCHECK
# undef snprintf
# define snprintf \
(GL_LINK_WARNING ("snprintf is unportable - " \
"use gnulib module snprintf for portability"), \
snprintf)
# undef fpurge
# define fpurge(f) \
(GL_LINK_WARNING ("fpurge is not always present - " \
"use gnulib module fpurge for portability"), \
fpurge (f))
#endif
#if @GNULIB_VSNPRINTF@
# if @REPLACE_VSNPRINTF@
# define vsnprintf rpl_vsnprintf
# endif
# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 3, 0)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef vsnprintf
# define vsnprintf(b,s,f,a) \
(GL_LINK_WARNING ("vsnprintf is unportable - " \
"use gnulib module vsnprintf for portability"), \
vsnprintf (b, s, f, a))
#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef fputc
# define fputc rpl_fputc
extern int fputc (int c, FILE *stream);
#endif
#if @GNULIB_SPRINTF_POSIX@
# if @REPLACE_SPRINTF@
# define sprintf rpl_sprintf
extern int sprintf (char *str, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef sprintf
# define sprintf \
(GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
"use gnulib module sprintf-posix for portable " \
"POSIX compliance"), \
sprintf)
#endif
#if @GNULIB_VSPRINTF_POSIX@
# if @REPLACE_VSPRINTF@
# define vsprintf rpl_vsprintf
extern int vsprintf (char *str, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef vsprintf
# define vsprintf(b,f,a) \
(GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
"use gnulib module vsprintf-posix for portable " \
"POSIX compliance"), \
vsprintf (b, f, a))
#endif
#if @GNULIB_DPRINTF@
# if @REPLACE_DPRINTF@
# define dprintf rpl_dprintf
# endif
# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@
extern int dprintf (int fd, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef dprintf
# define dprintf(d,f,a) \
(GL_LINK_WARNING ("dprintf is unportable - " \
"use gnulib module dprintf for portability"), \
dprintf (d, f, a))
#endif
#if @GNULIB_VDPRINTF@
# if @REPLACE_VDPRINTF@
# define vdprintf rpl_vdprintf
# endif
# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
extern int vdprintf (int fd, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef vdprintf
# define vdprintf(d,f,a) \
(GL_LINK_WARNING ("vdprintf is unportable - " \
"use gnulib module vdprintf for portability"), \
vdprintf (d, f, a))
#endif
#if @GNULIB_VASPRINTF@
# if @REPLACE_VASPRINTF@
# define asprintf rpl_asprintf
# define vasprintf rpl_vasprintf
# endif
# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
/* Write formatted output to a string dynamically allocated with malloc().
If the memory allocation succeeds, store the address of the string in
*RESULT and return the number of resulting bytes, excluding the trailing
NUL. Upon memory allocation error, or some other error, return -1. */
extern int asprintf (char **result, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int vasprintf (char **result, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
# endif
#endif
#if @GNULIB_OBSTACK_PRINTF@
# if @REPLACE_OBSTACK_PRINTF@
# define obstack_printf rpl_osbtack_printf
# define obstack_vprintf rpl_obstack_vprintf
# endif
# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
struct obstack;
/* Grow an obstack with formatted output. Return the number of
bytes added to OBS. No trailing nul byte is added, and the
object should be closed with obstack_finish before use. Upon
memory allocation error, call obstack_alloc_failed_handler. Upon
other error, return -1. */
extern int obstack_printf (struct obstack *obs, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *obs, const char *format,
va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
# endif
#endif
#if @GNULIB_FOPEN@
# if @REPLACE_FOPEN@
# undef fopen
# define fopen rpl_fopen
extern FILE * fopen (const char *filename, const char *mode);
# endif
#elif defined GNULIB_POSIXCHECK
# undef fopen
# define fopen(f,m) \
(GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \
"use gnulib module fopen for portability"), \
fopen (f, m))
#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef fputs
# define fputs rpl_fputs
extern int fputs (const char *string, FILE *stream);
#endif
#if @GNULIB_FREOPEN@
@ -316,22 +202,6 @@ extern FILE * freopen (const char *filename, const char *mode, FILE *stream);
freopen (f, m, s))
#endif
#if @GNULIB_FSEEKO@
# if @REPLACE_FSEEKO@
/* Provide fseek, fseeko functions that are aware of a preceding
fflush(), and which detect pipes. */
# define fseeko rpl_fseeko
extern int fseeko (FILE *fp, off_t offset, int whence);
# define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
# endif
#elif defined GNULIB_POSIXCHECK
# undef fseeko
# define fseeko(f,o,w) \
(GL_LINK_WARNING ("fseeko is unportable - " \
"use gnulib module fseeko for portability"), \
fseeko (f, o, w))
#endif
#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
extern int rpl_fseek (FILE *fp, long offset, int whence);
# undef fseek
@ -354,18 +224,20 @@ extern int rpl_fseek (FILE *fp, long offset, int whence);
# endif
#endif
#if @GNULIB_FTELLO@
# if @REPLACE_FTELLO@
# define ftello rpl_ftello
extern off_t ftello (FILE *fp);
# define ftell(fp) ftello (fp)
#if @GNULIB_FSEEKO@
# if @REPLACE_FSEEKO@
/* Provide fseek, fseeko functions that are aware of a preceding
fflush(), and which detect pipes. */
# define fseeko rpl_fseeko
extern int fseeko (FILE *fp, off_t offset, int whence);
# define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
# endif
#elif defined GNULIB_POSIXCHECK
# undef ftello
# define ftello(f) \
(GL_LINK_WARNING ("ftello is unportable - " \
"use gnulib module ftello for portability"), \
ftello (f))
# undef fseeko
# define fseeko(f,o,w) \
(GL_LINK_WARNING ("fseeko is unportable - " \
"use gnulib module fseeko for portability"), \
fseeko (f, o, w))
#endif
#if @GNULIB_FTELL@ && @REPLACE_FTELL@
@ -390,90 +262,18 @@ extern long rpl_ftell (FILE *fp);
# endif
#endif
#if @GNULIB_FFLUSH@
# if @REPLACE_FFLUSH@
# define fflush rpl_fflush
/* Flush all pending data on STREAM according to POSIX rules. Both
output and seekable input streams are supported.
Note! LOSS OF DATA can occur if fflush is applied on an input stream
that is _not_seekable_ or on an update stream that is _not_seekable_
and in which the most recent operation was input. Seekability can
be tested with lseek(fileno(fp),0,SEEK_CUR). */
extern int fflush (FILE *gl_stream);
#if @GNULIB_FTELLO@
# if @REPLACE_FTELLO@
# define ftello rpl_ftello
extern off_t ftello (FILE *fp);
# define ftell(fp) ftello (fp)
# endif
#elif defined GNULIB_POSIXCHECK
# undef fflush
# define fflush(f) \
(GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
"use gnulib module fflush for portable " \
"POSIX compliance"), \
fflush (f))
#endif
#if @GNULIB_FPURGE@
# if @REPLACE_FPURGE@
# define fpurge rpl_fpurge
# endif
# if @REPLACE_FPURGE@ || !@HAVE_DECL_FPURGE@
/* Discard all pending buffered I/O data on STREAM.
STREAM must not be wide-character oriented.
When discarding pending output, the file position is set back to where it
was before the write calls. When discarding pending input, the file
position is advanced to match the end of the previously read input.
Return 0 if successful. Upon error, return -1 and set errno. */
extern int fpurge (FILE *gl_stream);
# endif
#elif defined GNULIB_POSIXCHECK
# undef fpurge
# define fpurge(f) \
(GL_LINK_WARNING ("fpurge is not always present - " \
"use gnulib module fpurge for portability"), \
fpurge (f))
#endif
#if @GNULIB_FCLOSE@
# if @REPLACE_FCLOSE@
# define fclose rpl_fclose
/* Close STREAM and its underlying file descriptor. */
extern int fclose (FILE *stream);
# endif
#elif defined GNULIB_POSIXCHECK
# undef fclose
# define fclose(f) \
(GL_LINK_WARNING ("fclose is not always POSIX compliant - " \
"use gnulib module fclose for portable " \
"POSIX compliance"), \
fclose (f))
#endif
#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef fputc
# define fputc rpl_fputc
extern int fputc (int c, FILE *stream);
#endif
#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef putc
# define putc rpl_fputc
extern int putc (int c, FILE *stream);
#endif
#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef putchar
# define putchar rpl_putchar
extern int putchar (int c);
#endif
#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef fputs
# define fputs rpl_fputs
extern int fputs (const char *string, FILE *stream);
#endif
#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef puts
# define puts rpl_puts
extern int puts (const char *string);
# undef ftello
# define ftello(f) \
(GL_LINK_WARNING ("ftello is unportable - " \
"use gnulib module ftello for portability"), \
ftello (f))
#endif
#if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
@ -523,6 +323,26 @@ extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream);
getline (l, s, f))
#endif
#if @GNULIB_OBSTACK_PRINTF@
# if @REPLACE_OBSTACK_PRINTF@
# define obstack_printf rpl_osbtack_printf
# define obstack_vprintf rpl_obstack_vprintf
# endif
# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
struct obstack;
/* Grow an obstack with formatted output. Return the number of
bytes added to OBS. No trailing nul byte is added, and the
object should be closed with obstack_finish before use. Upon
memory allocation error, call obstack_alloc_failed_handler. Upon
other error, return -1. */
extern int obstack_printf (struct obstack *obs, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *obs, const char *format,
va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
# endif
#endif
#if @GNULIB_PERROR@
# if @REPLACE_PERROR@
# define perror rpl_perror
@ -539,6 +359,213 @@ extern void perror (const char *string);
perror (s))
#endif
#if @GNULIB_POPEN@
# if @REPLACE_POPEN@
# undef popen
# define popen rpl_popen
extern FILE *popen (const char *cmd, const char *mode);
# endif
#elif defined GNULIB_POSIXCHECK
# undef popen
# define popen(c,m) \
(GL_LINK_WARNING ("popen is buggy on some platforms - " \
"use gnulib module popen or pipe for more portability"), \
popen (c, m))
#endif
#if @GNULIB_PRINTF_POSIX@
# if @REPLACE_PRINTF@
/* Don't break __attribute__((format(printf,M,N))). */
# define printf __printf__
extern int printf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2)));
# endif
#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
/* Don't break __attribute__((format(printf,M,N))). */
# define printf __printf__
extern int printf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2)));
#elif defined GNULIB_POSIXCHECK
# undef printf
# define printf \
(GL_LINK_WARNING ("printf is not always POSIX compliant - " \
"use gnulib module printf-posix for portable " \
"POSIX compliance"), \
printf)
/* Don't break __attribute__((format(printf,M,N))). */
# define format(kind,m,n) format (__##kind##__, m, n)
# define __format__(kind,m,n) __format__ (__##kind##__, m, n)
# define ____printf____ __printf__
# define ____scanf____ __scanf__
# define ____strftime____ __strftime__
# define ____strfmon____ __strfmon__
#endif
#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef putc
# define putc rpl_fputc
extern int putc (int c, FILE *stream);
#endif
#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef putchar
# define putchar rpl_putchar
extern int putchar (int c);
#endif
#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef puts
# define puts rpl_puts
extern int puts (const char *string);
#endif
#if @GNULIB_RENAME@
# if @REPLACE_RENAME@
# undef rename
# define rename rpl_rename
extern int rename (const char *old, const char *new);
# endif
#elif defined GNULIB_POSIXCHECK
# undef rename
# define rename(o,n) \
(GL_LINK_WARNING ("rename is buggy on some platforms - " \
"use gnulib module rename for more portability"), \
rename (o, n))
#endif
#if @GNULIB_SNPRINTF@
# if @REPLACE_SNPRINTF@
# define snprintf rpl_snprintf
# endif
# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
extern int snprintf (char *str, size_t size, const char *format, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef snprintf
# define snprintf \
(GL_LINK_WARNING ("snprintf is unportable - " \
"use gnulib module snprintf for portability"), \
snprintf)
#endif
#if @GNULIB_SPRINTF_POSIX@
# if @REPLACE_SPRINTF@
# define sprintf rpl_sprintf
extern int sprintf (char *str, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef sprintf
# define sprintf \
(GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
"use gnulib module sprintf-posix for portable " \
"POSIX compliance"), \
sprintf)
#endif
#if @GNULIB_VASPRINTF@
# if @REPLACE_VASPRINTF@
# define asprintf rpl_asprintf
# define vasprintf rpl_vasprintf
# endif
# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
/* Write formatted output to a string dynamically allocated with malloc().
If the memory allocation succeeds, store the address of the string in
*RESULT and return the number of resulting bytes, excluding the trailing
NUL. Upon memory allocation error, or some other error, return -1. */
extern int asprintf (char **result, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int vasprintf (char **result, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
# endif
#endif
#if @GNULIB_VDPRINTF@
# if @REPLACE_VDPRINTF@
# define vdprintf rpl_vdprintf
# endif
# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
extern int vdprintf (int fd, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef vdprintf
# define vdprintf(d,f,a) \
(GL_LINK_WARNING ("vdprintf is unportable - " \
"use gnulib module vdprintf for portability"), \
vdprintf (d, f, a))
#endif
#if @GNULIB_VFPRINTF_POSIX@
# if @REPLACE_VFPRINTF@
# define vfprintf rpl_vfprintf
extern int vfprintf (FILE *fp, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
# endif
#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# define vfprintf rpl_vfprintf
extern int vfprintf (FILE *fp, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
#elif defined GNULIB_POSIXCHECK
# undef vfprintf
# define vfprintf(s,f,a) \
(GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
"use gnulib module vfprintf-posix for portable " \
"POSIX compliance"), \
vfprintf (s, f, a))
#endif
#if @GNULIB_VPRINTF_POSIX@
# if @REPLACE_VPRINTF@
# define vprintf rpl_vprintf
extern int vprintf (const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 1, 0)));
# endif
#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# define vprintf rpl_vprintf
extern int vprintf (const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 1, 0)));
#elif defined GNULIB_POSIXCHECK
# undef vprintf
# define vprintf(f,a) \
(GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
"use gnulib module vprintf-posix for portable " \
"POSIX compliance"), \
vprintf (f, a))
#endif
#if @GNULIB_VSNPRINTF@
# if @REPLACE_VSNPRINTF@
# define vsnprintf rpl_vsnprintf
# endif
# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 3, 0)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef vsnprintf
# define vsnprintf(b,s,f,a) \
(GL_LINK_WARNING ("vsnprintf is unportable - " \
"use gnulib module vsnprintf for portability"), \
vsnprintf (b, s, f, a))
#endif
#if @GNULIB_VSPRINTF_POSIX@
# if @REPLACE_VSPRINTF@
# define vsprintf rpl_vsprintf
extern int vsprintf (char *str, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
# endif
#elif defined GNULIB_POSIXCHECK
# undef vsprintf
# define vsprintf(b,f,a) \
(GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
"use gnulib module vsprintf-posix for portable " \
"POSIX compliance"), \
vsprintf (b, f, a))
#endif
#ifdef __cplusplus
}
#endif

View File

@ -207,6 +207,31 @@ extern char * mkdtemp (char * /*template*/);
#endif
#if @GNULIB_MKOSTEMP@
# if !@HAVE_MKOSTEMP@
/* Create a unique temporary file from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the file name unique.
The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
and O_TEXT, O_BINARY (defined in "binary-io.h").
The file is then created, with the specified flags, ensuring it didn't exist
before.
The file is created read-write (mask at least 0600 & ~umask), but it may be
world-readable and world-writable (mask 0666 & ~umask), depending on the
implementation.
Returns the open file descriptor if successful, otherwise -1 and errno
set. */
extern int mkostemp (char * /*template*/, int /*flags*/);
# endif
#elif defined GNULIB_POSIXCHECK
# undef mkostemp
# define mkostemp(t,f) \
(GL_LINK_WARNING ("mkostemp is unportable - " \
"use gnulib module mkostemp for portability"), \
mkostemp (t, f))
#endif
#if @GNULIB_MKSTEMP@
# if @REPLACE_MKSTEMP@
/* Create a unique temporary file from TEMPLATE.

View File

@ -206,11 +206,11 @@ extern char *strdup (char const *__s);
/* Return a newly allocated copy of at most N bytes of STRING. */
#if @GNULIB_STRNDUP@
# if ! @HAVE_STRNDUP@
# if @REPLACE_STRNDUP@
# undef strndup
# define strndup rpl_strndup
# endif
# if ! @HAVE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
# if @REPLACE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
extern char *strndup (char const *__string, size_t __n);
# endif
#elif defined GNULIB_POSIXCHECK
@ -402,7 +402,13 @@ extern char *strcasestr (const char *haystack, const char *needle)
See also strsep(). */
#if @GNULIB_STRTOK_R@
# if ! @HAVE_DECL_STRTOK_R@
# if @REPLACE_STRTOK_R@
# undef strtok_r
# define strtok_r rpl_strtok_r
# elif @UNDEFINE_STRTOK_R@
# undef strtok_r
# endif
# if ! @HAVE_DECL_STRTOK_R@ || @REPLACE_STRTOK_R@
extern char *strtok_r (char *restrict s, char const *restrict delim,
char **restrict save_ptr);
# endif

View File

@ -77,28 +77,28 @@ fraccompare (char const *a, char const *b, char decimal_point)
if (*a == decimal_point && *b == decimal_point)
{
while (*++a == *++b)
if (! ISDIGIT (*a))
return 0;
if (! ISDIGIT (*a))
return 0;
if (ISDIGIT (*a) && ISDIGIT (*b))
return *a - *b;
return *a - *b;
if (ISDIGIT (*a))
goto a_trailing_nonzero;
goto a_trailing_nonzero;
if (ISDIGIT (*b))
goto b_trailing_nonzero;
goto b_trailing_nonzero;
return 0;
}
else if (*a++ == decimal_point)
{
a_trailing_nonzero:
while (*a == NUMERIC_ZERO)
a++;
a++;
return ISDIGIT (*a);
}
else if (*b++ == decimal_point)
{
b_trailing_nonzero:
while (*b == NUMERIC_ZERO)
b++;
b++;
return - ISDIGIT (*b);
}
return 0;
@ -113,7 +113,7 @@ fraccompare (char const *a, char const *b, char decimal_point)
static inline int
numcompare (char const *a, char const *b,
int decimal_point, int thousands_sep)
int decimal_point, int thousands_sep)
{
unsigned char tmpa = *a;
unsigned char tmpb = *b;
@ -124,119 +124,119 @@ numcompare (char const *a, char const *b,
if (tmpa == NEGATION_SIGN)
{
do
tmpa = *++a;
tmpa = *++a;
while (tmpa == NUMERIC_ZERO || tmpa == thousands_sep);
if (tmpb != NEGATION_SIGN)
{
if (tmpa == decimal_point)
do
tmpa = *++a;
while (tmpa == NUMERIC_ZERO);
if (ISDIGIT (tmpa))
return -1;
while (tmpb == NUMERIC_ZERO || tmpb == thousands_sep)
tmpb = *++b;
if (tmpb == decimal_point)
do
tmpb = *++b;
while (tmpb == NUMERIC_ZERO);
return - ISDIGIT (tmpb);
}
{
if (tmpa == decimal_point)
do
tmpa = *++a;
while (tmpa == NUMERIC_ZERO);
if (ISDIGIT (tmpa))
return -1;
while (tmpb == NUMERIC_ZERO || tmpb == thousands_sep)
tmpb = *++b;
if (tmpb == decimal_point)
do
tmpb = *++b;
while (tmpb == NUMERIC_ZERO);
return - ISDIGIT (tmpb);
}
do
tmpb = *++b;
tmpb = *++b;
while (tmpb == NUMERIC_ZERO || tmpb == thousands_sep);
while (tmpa == tmpb && ISDIGIT (tmpa))
{
do
tmpa = *++a;
while (tmpa == thousands_sep);
do
tmpb = *++b;
while (tmpb == thousands_sep);
}
{
do
tmpa = *++a;
while (tmpa == thousands_sep);
do
tmpb = *++b;
while (tmpb == thousands_sep);
}
if ((tmpa == decimal_point && !ISDIGIT (tmpb))
|| (tmpb == decimal_point && !ISDIGIT (tmpa)))
return fraccompare (b, a, decimal_point);
|| (tmpb == decimal_point && !ISDIGIT (tmpa)))
return fraccompare (b, a, decimal_point);
tmp = tmpb - tmpa;
for (log_a = 0; ISDIGIT (tmpa); ++log_a)
do
tmpa = *++a;
while (tmpa == thousands_sep);
do
tmpa = *++a;
while (tmpa == thousands_sep);
for (log_b = 0; ISDIGIT (tmpb); ++log_b)
do
tmpb = *++b;
while (tmpb == thousands_sep);
do
tmpb = *++b;
while (tmpb == thousands_sep);
if (log_a != log_b)
return log_a < log_b ? 1 : -1;
return log_a < log_b ? 1 : -1;
if (!log_a)
return 0;
return 0;
return tmp;
}
else if (tmpb == NEGATION_SIGN)
{
do
tmpb = *++b;
tmpb = *++b;
while (tmpb == NUMERIC_ZERO || tmpb == thousands_sep);
if (tmpb == decimal_point)
do
tmpb = *++b;
while (tmpb == NUMERIC_ZERO);
do
tmpb = *++b;
while (tmpb == NUMERIC_ZERO);
if (ISDIGIT (tmpb))
return 1;
return 1;
while (tmpa == NUMERIC_ZERO || tmpa == thousands_sep)
tmpa = *++a;
tmpa = *++a;
if (tmpa == decimal_point)
do
tmpa = *++a;
while (tmpa == NUMERIC_ZERO);
do
tmpa = *++a;
while (tmpa == NUMERIC_ZERO);
return ISDIGIT (tmpa);
}
else
{
while (tmpa == NUMERIC_ZERO || tmpa == thousands_sep)
tmpa = *++a;
tmpa = *++a;
while (tmpb == NUMERIC_ZERO || tmpb == thousands_sep)
tmpb = *++b;
tmpb = *++b;
while (tmpa == tmpb && ISDIGIT (tmpa))
{
do
tmpa = *++a;
while (tmpa == thousands_sep);
do
tmpb = *++b;
while (tmpb == thousands_sep);
}
{
do
tmpa = *++a;
while (tmpa == thousands_sep);
do
tmpb = *++b;
while (tmpb == thousands_sep);
}
if ((tmpa == decimal_point && !ISDIGIT (tmpb))
|| (tmpb == decimal_point && !ISDIGIT (tmpa)))
return fraccompare (a, b, decimal_point);
|| (tmpb == decimal_point && !ISDIGIT (tmpa)))
return fraccompare (a, b, decimal_point);
tmp = tmpa - tmpb;
for (log_a = 0; ISDIGIT (tmpa); ++log_a)
do
tmpa = *++a;
while (tmpa == thousands_sep);
do
tmpa = *++a;
while (tmpa == thousands_sep);
for (log_b = 0; ISDIGIT (tmpb); ++log_b)
do
tmpb = *++b;
while (tmpb == thousands_sep);
do
tmpb = *++b;
while (tmpb == thousands_sep);
if (log_a != log_b)
return log_a < log_b ? -1 : 1;
return log_a < log_b ? -1 : 1;
if (!log_a)
return 0;
return 0;
return tmp;
}

View File

@ -25,7 +25,7 @@
int
strnumcmp (char const *a, char const *b,
int decimal_point, int thousands_sep)
int decimal_point, int thousands_sep)
{
return numcompare (a, b, decimal_point, thousands_sep);
}

View File

@ -426,5 +426,32 @@ extern int rpl_shutdown (int, int);
#endif /* HAVE_SYS_SOCKET_H */
#ifdef __cplusplus
extern "C" {
#endif
#if @GNULIB_ACCEPT4@
/* Accept a connection on a socket, with specific opening flags.
The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
and O_TEXT, O_BINARY (defined in "binary-io.h").
See also the Linux man page at
<http://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>. */
# if @HAVE_ACCEPT4@
# define accept4 rpl_accept4
# endif
extern int accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
int flags);
#elif defined GNULIB_POSIXCHECK
# undef accept4
# define accept4(s,a,l,f) \
(GL_LINK_WARNING ("accept4 is unportable - " \
"use gnulib module accept4 for portability"), \
accept4 (s, a, l, f))
#endif
#ifdef __cplusplus
}
#endif
#endif /* _GL_SYS_SOCKET_H */
#endif /* _GL_SYS_SOCKET_H */

View File

@ -306,6 +306,77 @@ extern int rpl_lstat (const char *name, struct stat *buf);
#endif
#if @GNULIB_FCHMODAT@
# if !@HAVE_FCHMODAT@
extern int fchmodat (int fd, char const *file, mode_t mode, int flag);
# endif
#elif defined GNULIB_POSIXCHECK
# undef fchmodat
# define fchmodat(d,n,m,f) \
(GL_LINK_WARNING ("fchmodat is not portable - " \
"use gnulib module openat for portability"), \
fchmodat (d, n, m, f))
#endif
#if @GNULIB_FSTATAT@
# if @REPLACE_FSTATAT@
# undef fstatat
# define fstatat rpl_fstatat
# endif
# if !@HAVE_FSTATAT@ || @REPLACE_FSTATAT@
extern int fstatat (int fd, char const *name, struct stat *st, int flags);
# endif
#elif defined GNULIB_POSIXCHECK
# undef fstatat
# define fstatat(d,n,s,f) \
(GL_LINK_WARNING ("fstatat is not portable - " \
"use gnulib module openat for portability"), \
fstatat (d, n, s, f))
#endif
#if @GNULIB_MKDIRAT@
# if !@HAVE_MKDIRAT@
extern int mkdirat (int fd, char const *file, mode_t mode);
# endif
#elif defined GNULIB_POSIXCHECK
# undef mkdirat
# define mkdirat(d,n,m) \
(GL_LINK_WARNING ("mkdirat is not portable - " \
"use gnulib module openat for portability"), \
mkdirat (d, n, m))
#endif
#if @GNULIB_MKFIFOAT@
# if !@HAVE_MKFIFOAT@
int mkfifoat (int fd, char const *file, mode_t mode);
# endif
#elif defined GNULIB_POSIXCHECK
# undef mkfifoat
# define mkfifoat(d,n,m) \
(GL_LINK_WARNING ("mkfifoat is not portable - " \
"use gnulib module mkfifoat for portability"), \
mkfifoat (d, n, m))
#endif
#if @GNULIB_MKNODAT@
# if !@HAVE_MKNODAT@
int mknodat (int fd, char const *file, mode_t mode, dev_t dev);
# endif
#elif defined GNULIB_POSIXCHECK
# undef mknodat
# define mknodat(f,n,m,d) \
(GL_LINK_WARNING ("mknodat is not portable - " \
"use gnulib module mkfifoat for portability"), \
mknodat (f, n, m, d))
#endif
#if @REPLACE_FCHDIR@
# define fstat rpl_fstat
extern int fstat (int fd, struct stat *buf);
#endif
#if @REPLACE_MKDIR@
# undef mkdir
# define mkdir rpl_mkdir

View File

@ -96,7 +96,7 @@ direxists (const char *dir)
enough space in TMPL. */
int
__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
int try_tmpdir)
int try_tmpdir)
{
const char *d;
size_t dlen, plen;
@ -110,30 +110,30 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
{
plen = strlen (pfx);
if (plen > 5)
plen = 5;
plen = 5;
}
if (try_tmpdir)
{
d = __secure_getenv ("TMPDIR");
if (d != NULL && direxists (d))
dir = d;
dir = d;
else if (dir != NULL && direxists (dir))
/* nothing */ ;
/* nothing */ ;
else
dir = NULL;
dir = NULL;
}
if (dir == NULL)
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
dir = P_tmpdir;
else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
dir = "/tmp";
dir = "/tmp";
else
{
__set_errno (ENOENT);
return -1;
}
{
__set_errno (ENOENT);
return -1;
}
}
dlen = strlen (dir);
@ -169,9 +169,9 @@ static const char letters[] =
KIND may be one of:
__GT_NOCREATE: simply verify that the name does not exist
at the time of the call.
at the time of the call.
__GT_FILE: create the file using open(O_CREAT|O_EXCL)
and return a read-write fd. The file is mode 0600.
and return a read-write fd. The file is mode 0600.
__GT_BIGFILE: same as __GT_FILE but use open64().
__GT_DIR: create a directory, which will be mode 0700.
@ -205,7 +205,7 @@ gen_tempname_len (char *tmpl, int kind, size_t x_suffix_len)
len = strlen (tmpl);
if (len < x_suffix_len || ! check_x_suffix (&tmpl[len - x_suffix_len],
x_suffix_len))
x_suffix_len))
{
__set_errno (EINVAL);
return -1;
@ -223,60 +223,60 @@ gen_tempname_len (char *tmpl, int kind, size_t x_suffix_len)
size_t i;
for (i = 0; i < x_suffix_len; i++)
{
XXXXXX[i] = letters[randint_genmax (rand_src, sizeof letters - 2)];
}
{
XXXXXX[i] = letters[randint_genmax (rand_src, sizeof letters - 2)];
}
switch (kind)
{
case __GT_FILE:
fd = small_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
break;
{
case __GT_FILE:
fd = small_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
break;
case __GT_BIGFILE:
fd = large_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
break;
case __GT_BIGFILE:
fd = large_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
break;
case __GT_DIR:
fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
break;
case __GT_DIR:
fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
break;
case __GT_NOCREATE:
/* This case is backward from the other three. This function
succeeds if __xstat fails because the name does not exist.
Note the continue to bypass the common logic at the bottom
of the loop. */
if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
{
if (errno == ENOENT)
{
__set_errno (save_errno);
fd = 0;
goto done;
}
else
{
/* Give up now. */
fd = -1;
goto done;
}
}
continue;
case __GT_NOCREATE:
/* This case is backward from the other three. This function
succeeds if __xstat fails because the name does not exist.
Note the continue to bypass the common logic at the bottom
of the loop. */
if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
{
if (errno == ENOENT)
{
__set_errno (save_errno);
fd = 0;
goto done;
}
else
{
/* Give up now. */
fd = -1;
goto done;
}
}
continue;
default:
assert (! "invalid KIND in __gen_tempname");
}
default:
assert (! "invalid KIND in __gen_tempname");
}
if (fd >= 0)
{
__set_errno (save_errno);
goto done;
}
{
__set_errno (save_errno);
goto done;
}
else if (errno != EEXIST)
{
fd = -1;
goto done;
}
{
fd = -1;
goto done;
}
}
randint_all_free (rand_src);

View File

@ -30,9 +30,9 @@
KIND may be one of:
GT_NOCREATE: simply verify that the name does not exist
at the time of the call.
at the time of the call.
GT_FILE: create a large file using open(O_CREAT|O_EXCL)
and return a read-write fd. The file is mode 0600.
and return a read-write fd. The file is mode 0600.
GT_DIR: create a directory, which will be mode 0700.
We use a clever algorithm to get hard-to-predict names. */

View File

@ -109,6 +109,15 @@
# define STDERR_FILENO 2
#endif
/* Ensure *_OK functions exist. */
#ifndef F_OK
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
#endif
/* Declare overridden functions. */
#ifdef __cplusplus
@ -141,6 +150,72 @@ extern int chown (const char *file, uid_t uid, gid_t gid);
#endif
#if @GNULIB_FCHOWNAT@
# if @REPLACE_FCHOWNAT@
# undef fchownat
# define fchownat rpl_fchownat
# endif
# if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@
extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag);
# endif
#elif defined GNULIB_POSIXCHECK
# undef fchownat
# define fchownat(d,n,o,g,f) \
(GL_LINK_WARNING ("fchownat is not portable - " \
"use gnulib module openat for portability"), \
fchownat (d, n, o, g, f))
#endif
#if @GNULIB_UNLINKAT@
# if !@HAVE_UNLINKAT@
extern int unlinkat (int fd, char const *file, int flag);
# endif
#elif defined GNULIB_POSIXCHECK
# undef unlinkat
# define unlinkat(d,n,f) \
(GL_LINK_WARNING ("unlinkat is not portable - " \
"use gnulib module openat for portability"), \
unlinkat (d, n, f))
#endif
#if @GNULIB_FACCESSAT@
# if !@HAVE_FACCESSAT@
int faccessat (int fd, char const *file, int mode, int flag);
# endif
#elif defined GNULIB_POSIXCHECK
# undef faccessat
# define faccessat(d,n,m,f) \
(GL_LINK_WARNING ("faccessat is not portable - " \
"use gnulib module faccessat for portability"), \
faccessat (d, n, m, f))
#endif
#if @GNULIB_SYMLINKAT@
# if !@HAVE_SYMLINKAT@
int symlinkat (char const *contents, int fd, char const *file);
# endif
#elif defined GNULIB_POSIXCHECK
# undef symlinkat
# define symlinkat(c,d,n) \
(GL_LINK_WARNING ("symlinkat is not portable - " \
"use gnulib module symlinkat for portability"), \
symlinkat (c, d, n))
#endif
#if @GNULIB_READLINKAT@
# if !@HAVE_READLINKAT@
ssize_t readlinkat (int fd, char const *file, char *buf, size_t len);
# endif
#elif defined GNULIB_POSIXCHECK
# undef readlinkat
# define readlinkat(d,n,b,l) \
(GL_LINK_WARNING ("readlinkat is not portable - " \
"use gnulib module symlinkat for portability"), \
readlinkat (d, n, b, l))
#endif
#if @GNULIB_CLOSE@
# if @REPLACE_CLOSE@
/* Automatically included by modules that need a replacement for close. */
@ -181,6 +256,28 @@ extern int dup2 (int oldfd, int newfd);
#endif
#if @GNULIB_DUP3@
/* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
specified flags.
The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
and O_TEXT, O_BINARY (defined in "binary-io.h").
Close NEWFD first if it is open.
Return newfd if successful, otherwise -1 and errno set.
See the Linux man page at
<http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
# if @HAVE_DUP3@
# define dup3 rpl_dup3
# endif
extern int dup3 (int oldfd, int newfd, int flags);
#elif defined GNULIB_POSIXCHECK
# undef dup3
# define dup3(o,n,f) \
(GL_LINK_WARNING ("dup3 is unportable - " \
"use gnulib module dup3 for portability"), \
dup3 (o, n, f))
#endif
#if @GNULIB_ENVIRON@
# if !@HAVE_DECL_ENVIRON@
/* Set of environment variables and values. An array of strings of the form
@ -229,11 +326,11 @@ extern int fchdir (int /*fd*/);
# define dup rpl_dup
extern int dup (int);
# if @REPLACE_DUP2@
# undef dup2
# endif
# define dup2 rpl_dup2_fchdir
extern int dup2 (int, int);
/* Gnulib internal hooks needed to maintain the fchdir metadata. */
extern int _gl_register_fd (int fd, const char *filename);
extern void _gl_unregister_fd (int fd);
extern int _gl_register_dup (int oldfd, int newfd);
extern const char *_gl_directory_name (int fd);
# endif
#elif defined GNULIB_POSIXCHECK
@ -331,7 +428,8 @@ extern int getdomainname(char *name, size_t len);
#if @GNULIB_GETDTABLESIZE@
# if !@HAVE_GETDTABLESIZE@
/* Return the maximum number of file descriptors in the current process. */
/* Return the maximum number of file descriptors in the current process.
In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
extern int getdtablesize (void);
# endif
#elif defined GNULIB_POSIXCHECK
@ -500,11 +598,14 @@ extern int lchown (char const *file, uid_t owner, gid_t group);
#if @GNULIB_LINK@
# if @REPLACE_LINK@
# define link rpl_link
# endif
/* Create a new hard link for an existing file.
Return 0 if successful, otherwise -1 and errno set.
See POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/link.html>. */
# if !@HAVE_LINK@
# if !@HAVE_LINK@ || @REPLACE_LINK@
extern int link (const char *path1, const char *path2);
# endif
#elif defined GNULIB_POSIXCHECK
@ -534,6 +635,28 @@ extern int link (const char *path1, const char *path2);
#endif
#if @GNULIB_PIPE2@
/* Create a pipe, applying the given flags when opening the read-end of the
pipe and the write-end of the pipe.
The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
and O_TEXT, O_BINARY (defined in "binary-io.h").
Store the read-end as fd[0] and the write-end as fd[1].
Return 0 upon success, or -1 with errno set upon failure.
See also the Linux man page at
<http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
# if @HAVE_PIPE2@
# define pipe2 rpl_pipe2
# endif
extern int pipe2 (int fd[2], int flags);
#elif defined GNULIB_POSIXCHECK
# undef pipe2
# define pipe2(f,o) \
(GL_LINK_WARNING ("pipe2 is unportable - " \
"use gnulib module pipe2 for portability"), \
pipe2 (f, o))
#endif
#if @GNULIB_READLINK@
/* Read the contents of the symbolic link FILE and place the first BUFSIZE
bytes of it into BUF. Return the number of bytes placed into BUF if
@ -579,12 +702,6 @@ extern ssize_t write (int fd, const void *buf, size_t count);
#endif
#ifdef FCHDIR_REPLACEMENT
/* gnulib internal function. */
extern void _gl_unregister_fd (int fd);
#endif
#ifdef __cplusplus
}
#endif

View File

@ -1,7 +1,7 @@
/* Set file access and modification times.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software
Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free
Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@ -44,16 +44,6 @@ struct utimbuf
};
#endif
/* Some systems don't have ENOSYS. */
#ifndef ENOSYS
# ifdef ENOTSUP
# define ENOSYS ENOTSUP
# else
/* Some systems don't have ENOTSUP either. */
# define ENOSYS EINVAL
# endif
#endif
#ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
# define __attribute__(x)

View File

@ -260,7 +260,7 @@ local_wcsnlen (const wchar_t *s, size_t maxlen)
# ifndef decimal_point_char_defined
# define decimal_point_char_defined 1
static char
decimal_point_char ()
decimal_point_char (void)
{
const char *point;
/* Determine it in a multithread-safe way. We know nl_langinfo is

View File

@ -1,2 +1,2 @@
#include <config.h>
char const *Version = "7.4";
char const *Version = "7.6";

View File

@ -3,7 +3,7 @@
#line 1
/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
Copyright (C) 2006-2008 Free Software Foundation, Inc.
Copyright (C) 2006-2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -87,6 +87,8 @@
# undef iswspace
# undef iswupper
# undef iswxdigit
# undef towlower
# undef towupper
/* Linux libc5 has <wctype.h> and the functions but they are broken. */
# if @REPLACE_ISWCNTRL@
@ -102,6 +104,8 @@
# define iswspace rpl_iswspace
# define iswupper rpl_iswupper
# define iswxdigit rpl_iswxdigit
# define towlower rpl_towlower
# define towupper rpl_towupper
# endif
static inline int
@ -181,7 +185,50 @@ iswxdigit (wint_t wc)
|| ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
}
static inline wint_t
towlower (wint_t wc)
{
return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
}
static inline wint_t
towupper (wint_t wc)
{
return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
}
# endif /* ! HAVE_ISWCNTRL */
# if defined __MINGW32__
/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
The functions towlower and towupper are implemented in the MSVCRT library
to take a wchar_t argument and return a wchar_t result. mingw declares
these functions to take a wint_t argument and return a wint_t result.
This means that:
1. When the user passes an argument outside the range 0x0000..0xFFFF, the
function will look only at the lower 16 bits. This is allowed according
to POSIX.
2. The return value is returned in the lower 16 bits of the result register.
The upper 16 bits are random: whatever happened to be in that part of the
result register. We need to fix this by adding a zero-extend from
wchar_t to wint_t after the call. */
static inline wint_t
rpl_towlower (wint_t wc)
{
return (wint_t) (wchar_t) towlower (wc);
}
# define towlower rpl_towlower
static inline wint_t
rpl_towupper (wint_t wc)
{
return (wint_t) (wchar_t) towupper (wc);
}
# define towupper rpl_towupper
# endif
#endif /* _GL_WCTYPE_H */
#endif /* _GL_WCTYPE_H */

View File

@ -31,11 +31,11 @@ xfreopen (char const *filename, char const *mode, FILE *fp)
if (!freopen (filename, mode, fp))
{
char const *f = (filename ? filename
: (fp == stdin ? _("stdin")
: (fp == stdout ? _("stdout")
: (fp == stderr ? _("stderr")
: _("unknown stream")))));
: (fp == stdin ? _("stdin")
: (fp == stdout ? _("stdout")
: (fp == stderr ? _("stderr")
: _("unknown stream")))));
error (exit_failure, errno, _("failed to reopen %s with mode %s"),
quote_n (0, f), quote_n (1, mode));
quote_n (0, f), quote_n (1, mode));
}
}

Some files were not shown because too many files have changed in this diff Show More