Commit Graph

144 Commits

Author SHA1 Message Date
James Youngman
4536a852d4 Remove trailing white space. 2009-04-13 13:33:24 +01:00
James Youngman
2d409557eb Avoid mixing declarations and statements.
* lib/buildcmd.c (bc_do_exec): Declare variables at the top of the
relevant block, in order to avoid mixing declarations and
statements.
* xargs/xargs.c (main): Likewise.

* NEWS: Mention the fix for bug #22708 in the correct section.
2009-04-13 13:10:54 +01:00
Leslie P. Polzer
4a3aa315e6 Merge Leslie Polzer's SOC 2007 changes for better ARG_MAX support
2008-03-23  Leslie Polzer  <leslie.polzer@gmx.net>

	Merge Leslie Polzer's ARG_MAX enhancements to xargs which were
	produced as part of the Google Summer of Code 2007.
	These changes fix Savannah bug #22708.
	* find/pred.c (launch): The struct buildcmd_control* argument is
	no longer const.
	* find/defs.h: Likewise
	* lib/buildcmd.c (bc_do_insert): The struct buildcmd_control*
	argument is no longer const.
	(bc_push_arg): Likewise.
	(cb_exec_noop): Likewise.
	(get_stringv_len): New function; measures the length of
	a NULL-terminated argv sequence.
	(bc_do_exec): Rename from do_exec, and make global.  Modify the
	function to react to exec failing with E2BIG by trying again
	with fewer arguments.
	* xargs/xargs.1: Mention that xargs automatically adopts to the
	situation where exec fails with E2BIG.
	* xargs/xargs.c: (parent): New variable, the PID of the parent
	process.
	(main): initialise the variable 'parent'.   Don't fail immediately
	due to lack of space when the environment is large.  Call
	xargs_do_exec via bc_do_exec.
	(xargs_do_exec): The struct buildcmd_control* argument is no
	longer const.   When exec fails in the child, communicate the
	errno value back to the parent through a pipe which is
	close-on-exec; this allows us to accurately determine the cause of
	the failure and also to distinguish exec failures from all
	possible exit codes in the child.
	(wait_for_proc): If the utility cannot be found or cannot be run,
	we now find out about this by reading an errno value from the
	pipe, so this means that exit codes 126 and 127 in the child no
	longer have a special interpretation.
	* NEWS: mention these changes.
2009-04-13 13:10:53 +01:00
James Youngman
9c94cc62e3 Remove unnecessary include guards.
Remove "lib/wait.h", since gnulib provides <sys/wait.h>.
* lib/Makefile.am (EXTRA_DIST): Remove wait.h, since gnulib
provides it.
* lib/wait.h: Not needed.
* find/pred.c: Include <sys/wait.h> instead of "wait.h".
* lib/waitpid.c: Likewise.
* xargs/xargs.c: Likewise.

Remove unnecessary include guards.
* lib/dircallback.c: gnulib provides <locale.h>, so no need for
include guards.
* locate/locate.c: Likewise.
* lib/listfile.c: Likewise.
* lib/savedirinfo.c: Likewise with <sys/stat.h>
* find/defs.h: gnulib provides <inttypes.h>, so no need for
include guards.
* lib/nextelem.c: Likewise with <string.h> and <stdlib.h>.
* locate/bigram.c: Likewise.
* locate/frcode.c: Likewise.
* lib/buildcmd.c: Likewise with <locale.h> and <wchar.h>
* xargs/xargs.c: Likewise with <locale.h>, <wchar.h> and <stdlib.h>
* import-gnulib.config (modules): Import the mbrtowc and whchar
modules.
* lib/qmark.c (multibyte_qmark_chars):  Don't surround with
HAVE_MBRTOWC, since we now have a replacement for mbrtowc.
Likewise, don't protect inclusion of <string.h> with
HAVE_STRING_H.  Likewise with <wchar.h>.
(multibyte_qmark_chars): Rename to qmark_chars.
(qmark_chars): Remove old version (since it is replaced by the
function that used to be multibyte_qmark_chars).
* lib/printquoted.c: Don't include <wchar.h>, we don't need it.

Signed-off-by: James Youngman <jay@gnu.org>
2009-04-12 11:26:52 +01:00
James Youngman
6ba6fbaa96 Enabled GCC warnings for declarations after statements.
Enabled GCC warnings for declarations after statements.
* import-gnulib.config: Import the gnulib module 'warnings'
* configure.ac: Add GCC warning -Wdeclaration-after-statement.
* Makefile.am: Add AM_CFLAGS and set it to $(WARN_CFLAGS).
* find/Makefile.am, doc/Makefile.am, lib/Makefile.am: Likewise.
* locate/Makefile.am, xargs/Makefile.am: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2009-03-04 11:07:50 +00:00
James Youngman
5dce9f443c Removed trailing whitespace.
Removed trailing whitespace.
* Makefile.am: Removed trailing white space.
* NEWS, build-aux/check-testfiles.sh, build-aux/src-sniff.py,
doc/Makefile.am, doc/find-maint.texi, doc/find.texi, find/Makefile.am,
find/defs.h, find/find.1, find/find.c, find/finddata.c, find/fstype.c,
find/ftsfind.c, find/parser.c, find/pred.c, find/tree.c, find/util.c,
import-gnulib.sh, lib/Makefile.am, lib/buildcmd.c, lib/buildcmd.h,
lib/dircallback.c, lib/dircallback.h, lib/extendbuf.c,
lib/extendbuf.h, lib/findutils-version.c, lib/findutils-version.h,
lib/forcefindlib.c, lib/gnulib-version.h, lib/listfile.c,
lib/modetype.h, lib/nextelem.c, lib/nextelem.h, lib/printquoted.c,
lib/printquoted.h, lib/qmark.c, lib/regexprops.c, lib/regextype.c,
lib/savedirinfo.c, lib/savedirinfo.h, lib/strspn.c, lib/wait.h,
lib/waitpid.c, locate/bigram.c, locate/code.c, locate/locate.1,
locate/locate.c, locate/locatedb.5, locate/locatedb.h,
locate/updatedb.1, locate/updatedb.sh, locate/word_io.c,
m4/findlib.m4, m4/nullsort.m4, m4/withfts.m4, xargs/xargs.1: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2009-03-04 10:49:59 +00:00
James Youngman
bece71c9b0 Update gnulib version; follow gnulib-tool's Makefile.am edit suggestions.
Update gnulib version.
* import-gnulib.config (gpl3_update_files): No longer need to
update the licenses of build-aux/mdate-sh, build-aux/texinfo.tex
or build-aux/ylwrap as they are already GPLv3+.
(modules): Use the strdup-posix module instead of strdup, and stop
using the obsolete modules memcmp and memset, since we now assume
those functions will already be present on the host system.
* import-gnulib.sh (rehack): Be more verbose about which files
actually needed a license edit and which did not.

Follow gnulib-tool's Makefile.am edit suggestions.
* find/Makefile.am (LDADD): Use $(LIBINTL) instead of @INTLLIBS@
and use $(LIB_CLOCK_GETTIME) instead of @LIB_CLOCK_GETTIME@.
* lib/Makefile.am: Likewise.
* locate/Makefile.am: Likewise.
* xargs/Makefile.am: Likewise.
* import-gnulib.sh (hack_gnulib_tool_output): Add
m4/gnulib-cache.m4 to EXTRA_DIST in gnulib/Makefile.am, as
gnulib-tool suggests.
2009-02-21 14:55:56 +00:00
Jim Meyering
10a9219ff2 find: avoid warning about unused local, remove unnecessary include.
* find/pred.c (scan_for_digit_differences): Remove declaration of
unused local, "ok".
(do_time_format): Remove decl of "done"; replace sole use with a
constant, "true".  Initialize "i" and "n".
* lib/dircallback.c: Don't include unistd.h.  Not needed.
2009-02-21 13:36:49 +00:00
James Youngman
e2b1bc2ac9 Update version of gnulib in order to pull in Jim Meyering's performance imporvements to fts 2008-11-08 14:26:32 +00:00
James Youngman
447dee1b43 Applied patch from Jim Meyering; rename dirfd to dir_fd to avoid shadowing problem 2008-03-10 09:39:29 +00:00
James Youngman
b99109f921 Applied tiny change from Ralf Wildenhues and updated the gnulib version 2008-02-13 23:52:04 +00:00
James Youngman
4af5f5eed5 Backed out the positional parameter change because it was too error prone and over-complex 2007-12-20 21:53:55 +00:00
James Youngman
f7dc6a9f0b Enhancements to format strings in hman-readable messages intended to allow better translation 2007-12-19 21:16:33 +00:00
James Youngman
f183ab2db9 Support the generation of regexprops-generic.texi. 2007-11-29 11:17:14 +00:00
Eric Blake
dc16c62ec4 Update to recent gnulib addition of idcache.h.
* lib/listfile.c (getuser, getgroup): Use header rather than
declaring things ourself.
* po/POTFILES.in (locate/frcode.c): Add missing file.
2007-08-23 02:33:31 +00:00
Eric Blake
578ead6ff1 Fix Savannah bug #20751.
* lib/listfile.c (list_file): Accomodate gnulib change of 3 Jul
2006.
* NEWS: Document this.
Reported by Nigel Stepp.
* THANKS: Sort and update.
* AUTHORS: Add myself.
2007-08-19 15:31:38 +00:00
Eric Blake
756cecd45b Allow choice of default arg size, Savannah bug #20594.
* configure.ac (DEFAULT_ARG_SIZE): Check environment for a default
size override.
* lib/buildcmd.c (bc_use_sensible_arg_max): Use default size from
configure, if requested.
* README (DEFAULT_ARG_SIZE): Mention the ability to tune this at
configure time.
* NEWS: Document the change.
2007-08-01 03:39:57 +00:00
James Youngman
1bd53425e8 Fixed Savannah bug #20547, version information not compliant with GNU coding standard 2007-07-22 13:08:22 +00:00
James Youngman
1c43fc92b5 Migrated from GPL version 2 to GPL version 3 2007-07-02 08:25:45 +00:00
James Youngman
f7671dc609 Fix Savannah bug #20263 (compilation err on DEC OSF/1. Include <sys/stat.h> in files where where we use struct stat. Removed some dead code following some calls to assert(0), which are now backed up by abort calls. Use assert (0) rather than assert (false). Make sure we include the space. 2007-06-26 08:24:19 +00:00
James Youngman
6e06a9fc28 Ignore the usually-ignored files in git 2007-06-24 16:47:40 +00:00
James Youngman
5a7e83f1d7 Fixed various lint complaints pointed out by build-aux/src-sniff.py 2007-06-21 23:41:08 +00:00
James Youngman
992bf3fd7e Applied patch for Savannah bug #20210 by Eric Blake 2007-06-19 22:28:03 +00:00
James Youngman
c47b198b43 Added some extra information about more obscure file types. 2007-05-27 10:34:03 +00:00
James Youngman
a0ab43812d Correctly detect and diagnose I/O errors in print-related predicates. This fixed Savannah bug #19416 2007-05-06 12:35:07 +00:00
James Youngman
dc4a7adf94 Bugfixes for Savannah bugs #19768 and #19766 2007-05-01 09:46:30 +00:00
James Youngman
cd1f15947f Use const char* parameters for pathnames 2007-04-29 23:28:50 +00:00
James Youngman
20102fc931 Minor changes relating to conditional includes that no longer need the conditional, and fixing some out of date comments 2007-04-29 01:27:56 +00:00
James Youngman
5f288d46f4 Avoid calling stat for pred_delete. Instead, try the unlink assuming the target is a file and then try again with the AT_REMOVEDIR flag if errno gets set to EISDIR 2007-04-28 17:51:14 +00:00
James Youngman
3d2128d30c Simplifythe calculation of the defautl value of xargs's -s option. Avoid an assertion failure on AIX when _SC_ARG_MAX is larger than LINE_MAX 2007-04-28 14:27:40 +00:00
James Youngman
52360fa978 Call gnulib's mbsstr() instead of a locally-defined mbsstr() 2007-04-25 09:26:10 +00:00
James Youngman
455a3be584 Added SOC guidance comments 2007-04-24 22:08:36 +00:00
James Youngman
d86012a34d Removed unused code. 2007-04-23 09:19:21 +00:00
James Youngman
e6adb9061f Fixes to ensure that 'make distcheck' works 2007-04-15 14:46:39 +00:00
James Youngman
b46b0d8938 Support fts() in FTS_CWDFD mode. Also work around Savannah bug #18466 (with a performance penalty). 2007-04-14 21:41:59 +00:00
James Youngman
70f1a3d1ea New method of checking out and configuring gnulib - define which version we need to use, and remember which version we used 2007-02-28 23:55:47 +00:00
James Youngman
c7ca8e10f2 Eliminated a few compiler warnings 2007-02-25 12:05:51 +00:00
James Youngman
cdf4370ad4 Applied trivial patch from supriya kannery <supriyak@in.ibm.com> which fixes a memory leak. 2007-02-24 10:01:54 +00:00
James Youngman
f198887c2e Fixed typo 2007-01-22 10:34:02 +00:00
James Youngman
c3cdc1bec8 define find_blocksize() and provide a declaration for get_link_name() 2006-12-29 19:32:10 +00:00
James Youngman
77c2709e77 Work around Savannah bug #17877, which manifests on systems which use
the same inode number for more than one file (smbfs, FAT, sometimes
some FUSE-based ones).  This happens for unreferenced files.  Fix
suggested by Jim Meyering.
2006-11-20 22:32:08 +00:00
James Youngman
7bdf3f39e5 Fixed Svannah bug #17782 ('./' prefix added at start of arg while it should be added at the start of the expansion of {}) 2006-11-08 07:11:43 +00:00
James Youngman
9499a434f9 Applied patches from Paul Eggert 2006-08-20 18:18:42 +00:00
James Youngman
586576db4e Updated callers of the gnnulib filemode module so that they work with the 2006-07-09 version of gnulib 2006-08-10 19:36:09 +00:00
James Youngman
afd3f429f1 Fixed Savannah bug#16738, find does not subtract environment size in find .. -exec {} + 2006-08-05 18:02:54 +00:00
James Youngman
7046234c8b Fixed many compilation warnings 2005-12-23 18:24:20 +00:00
James Youngman
2d5be965c2 Initial code to allow control over how -ls quote (or does not quote) control characters; not enabled yet 2005-12-12 06:59:18 +00:00
James Youngman
b070e1fff0 Prefer the word 'Invalid' or the phrase 'not allowed' over 'Illegal', as per the GNU coding standards, and as per the suggestion from Benno Schulenberg 2005-11-29 07:21:41 +00:00
James Youngman
ceb1f0aef4 Merge to trunk from 4.2.x fixes 2005-11-24 01:41:47 +00:00
James Youngman
dd0afc6850 Merged changes from the 4.2.x branch 2005-11-23 07:06:13 +00:00