[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Findutils-patches] [PATCH] bug 20273
From: |
Eric Blake |
Subject: |
Re: [Findutils-patches] [PATCH] bug 20273 |
Date: |
Thu, 23 Aug 2007 08:36:57 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 8/20/2007 7:20 AM:
> According to Eric Blake-1 on 6/27/2007 12:10 PM:
>> Since this is a bug fix, is it worth backporting this to the
>> 4.2 branch?
>
> Earlier you said this is okay; I still haven't attempted it, because the
> branch's use of gnulib is so much further out of date.
Finally, now that I've updated gnulib on the branch, this is the backport
to the branch. OK to commit?
2007-08-23 Eric Blake <address@hidden>
Fix Savannah bug #20273, partial reads of seekable stdin.
* import-gnulib.config (modules): Add closein.
* xargs/xargs.c (main, get_input_delimiter): Fix compile
warnings.
(main): Use close_stdin, not close_stdout.
* find/find.c (main): Likewise.
* NEWS: Document the fix.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGzZuJ84KuGfSFAYARAphlAJ4i1s+jpkqGIkPrgOEF5LfZyVLE8ACgunmv
y1tryRqz9QFD2e7meUbR3vw=
=crrr
-----END PGP SIGNATURE-----
Index: NEWS
===================================================================
RCS file: /sources/findutils/findutils/NEWS,v
retrieving revision 1.101.2.37
diff -u -p -b -r1.101.2.37 NEWS
--- NEWS 18 Aug 2007 16:54:16 -0000 1.101.2.37
+++ NEWS 23 Aug 2007 14:34:30 -0000
@@ -20,6 +20,12 @@ gnulib dirname module. The leak had bee
#20751: Avoid memory corruption in find -ls that has been present
since 4.2.28.
+#20273: When xargs is successful without consuming all of stdin (for
+example, with the -E option), and stdin is seekable, xargs now
+correctly restores the file position, even on platforms where exit()
+does not follow the POSIX rules of doing likewise. Likewise for find
+(for example, with the -ok action).
+
** Enhancements
#20688: The warning printed by -name or -iname when the pattern to
Index: import-gnulib.config
===================================================================
RCS file: /sources/findutils/findutils/import-gnulib.config,v
retrieving revision 1.1.2.4
diff -u -p -b -r1.1.2.4 import-gnulib.config
--- import-gnulib.config 23 Aug 2007 14:14:33 -0000 1.1.2.4
+++ import-gnulib.config 23 Aug 2007 14:34:30 -0000
@@ -23,6 +23,7 @@ modules='
alloca
argmatch
canonicalize
+closein
closeout
dirname
error
Index: xargs/xargs.c
===================================================================
RCS file: /sources/findutils/findutils/xargs/xargs.c,v
retrieving revision 1.49.2.16
diff -u -p -b -r1.49.2.16 xargs.c
--- xargs/xargs.c 14 Jul 2007 15:38:05 -0000 1.49.2.16
+++ xargs/xargs.c 23 Aug 2007 14:34:30 -0000
@@ -167,7 +167,7 @@ typedef int boolean;
#endif
#include <xalloc.h>
-#include "closeout.h"
+#include "closein.h"
#include "gnulib-version.h"
void error PARAMS ((int status, int errnum, char *message,...));
@@ -379,6 +379,7 @@ get_input_delimiter(const char *s)
error(1, 0,
_("Invalid input delimiter specification %s: the delimiter must
be either a single character or an escape sequence starting with \\."),
s);
+ abort ();
}
}
}
@@ -406,7 +407,6 @@ main (int argc, char **argv)
char *default_cmd = "/bin/echo";
int (*read_args) PARAMS ((void)) = read_line;
void (*act_on_init_result)(void) = noop;
- int env_too_big = 0;
enum BC_INIT_STATUS bcstatus;
program_name = argv[0];
@@ -417,7 +417,7 @@ main (int argc, char **argv)
#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- atexit (close_stdout);
+ atexit (close_stdin);
atexit (wait_for_proc_all);
bcstatus = bc_init_controlinfo(&bc_ctl);
Index: find/find.c
===================================================================
RCS file: /sources/findutils/findutils/find/find.c,v
retrieving revision 1.94.2.4
diff -u -p -b -r1.94.2.4 find.c
--- find/find.c 5 Aug 2007 12:48:55 -0000 1.94.2.4
+++ find/find.c 23 Aug 2007 14:34:30 -0000
@@ -50,7 +50,7 @@
#include "../gnulib/lib/xalloc.h"
#include "../gnulib/lib/human.h"
#include "../gnulib/lib/canonicalize.h"
-#include "closeout.h"
+#include "closein.h"
#include <modetype.h>
#include "savedirinfo.h"
#include "buildcmd.h"
@@ -418,7 +418,7 @@ main (int argc, char **argv)
#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- atexit (close_stdout);
+ atexit (close_stdin);
if (isatty(0))