[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: Gecko/20070515 Firefox/


                 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



POSIX requires the following behavior when stdin is seekable:

$ cat blah
$ (xargs -E2 echo; cat) < blah

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

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:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]