Re: [hackers] [sbase] [PATCH 09/10] tail: Use fstat in case file is removed

From: Michael Forney <mforney_AT_mforney.org>
Date: Mon, 5 Dec 2016 01:28:26 -0800

On Mon, Dec 5, 2016 at 1:20 AM, Hiltjo Posthuma <hiltjo_AT_codemadness.org> wrote:
> On Sun, Dec 04, 2016 at 09:55:11PM -0800, Michael Forney wrote:
>> ---
>> tail.c | 16 +++++++---------
>> 1 file changed, 7 insertions(+), 9 deletions(-)
>>
>> diff --git a/tail.c b/tail.c
>> index ad97308..000be62 100644
>> --- a/tail.c
>> +++ b/tail.c
>> _AT_@ -133,7 +133,7 @@ main(int argc, char *argv[])
>> }
>> if (many)
>> printf("%s==> %s <==\n", newline ? "\n" : "", *argv);
>> - if (stat(*argv, &st1) < 0)
>> + if (fstat(fileno(fp), &st1) < 0)
>> eprintf("stat %s:", *argv);
>
> The error message should be "fstat" here instead of "stat".

Thanks, I've updated it locally and will send a v2 patch set later.
Received on Mon Dec 05 2016 - 10:28:26 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 05 2016 - 10:36:18 CET