Skip to content

tac: should fail when stdin is closed but doesn't #2873

Open
@jfinkels

Description

@jfinkels

The uutils version of tac disagrees with GNU tac in the case where stdin is closed on the command line:

GNU prints an error message to stderr and returns exit status code 1:

$ tac <&-
tac: 'standard input': read error: Bad file descriptor
tac: -: Bad file descriptor

<&- means close stdin.

uutils prints nothing and returns exit status code 0:

$ ./target/debug/coreutils tac <&-

Edit: This causes a failure in the GNU test file tests/tac/tac-2-nonseekable.sh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions