bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sed bug on seekable stdin


From: Chuck Swiger
Subject: Re: sed bug on seekable stdin
Date: Sun, 17 Dec 2006 14:21:18 -0500
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Bob Proulx wrote:
Paolo Bonzini wrote:
[ ... ]
AFAIK fflush() is not needed in input streams as its purpose is to
flush pending output buffers and input streams have none.

Agreed.

+      fseek(stdin, 0, SEEK_CUR);
+      fclose(stdin);

How are I/O errors on stdin handled in this case?

A good question.

I'd like to understand the motivation of this patch a little better; it is to ensure something like consistent tape positioning if you attach sed's stdin to a non-rewind tape drive (/dev/nst or similar)? Or are you trying to make sure that some utility earlier in the pipeline doesn't get an unexpected SIGPIPE?

--
-Chuck




reply via email to

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