[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #20273] xargs -E consumes too much input
From: |
Eric Blake |
Subject: |
[bug #20273] xargs -E consumes too much input |
Date: |
Tue, 26 Jun 2007 22:17:14 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 |
URL:
<http://savannah.gnu.org/bugs/?20273>
Summary: xargs -E consumes too much input
Project: findutils
Submitted by: ericb
Submitted on: Tuesday 06/26/2007 at 16:17
Category: xargs
Severity: 3 - Normal
Item Group: Wrong result
Status: Needs Assignment
Privacy: Public
Assigned to: None
Originator Name: Eric Blake
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: 4.1.20
Fixed Release: None
_______________________________________________________
Details:
POSIX requires the following behavior when stdin is seekable:
$ cat blah
1
2
3
$ (xargs -E2 echo; cat) < blah
1
3
$
On systems where exit() does not follow the POSIX rule of restoring seekable
input streams back to the next unread character, xargs fails to reset the
seekable stream, leading to this result (tested on a Linux machine with glibc
2.3 and xargs 4.1.20):
$ (xargs -E2 echo; cat) < blah
1
$
Although I haven't yet had time to test that the latest findutils still has
the bug on this particular Linux machine, I suspect the bug will remain until
the point that xargs switches to using the gnulib closein module (it currently
only uses the closeout module, which leaves stdin alone).
Machines like Solaris or recent cygwin (1.5.24 or later) do not have this
bug, because exit() implies fflush(stdin) which obeys POSIX in this regard.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?20273>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug #20273] xargs -E consumes too much input,
Eric Blake <=