bug-coreutils
[Top][All Lists]
Advanced

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

Re: no feedback on snapshot? coreutils-7.5 coming soon


From: Jim Meyering
Subject: Re: no feedback on snapshot? coreutils-7.5 coming soon
Date: Thu, 13 Aug 2009 16:48:40 +0200

Pádraig Brady wrote:
> Jim Meyering wrote:
>> Pádraig Brady wrote:
>>> Subject: [PATCH] tail: fix tail -f failure when inotify used
>>>
>>> * src/tail.c (tail_inotify_forever): Use the correct bounds
>>> in the error check of the return from inotify_add_watch().
>>> Reported by C de-Avillez.
>>> ---
>>>  src/tail.c |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/src/tail.c b/src/tail.c
>>> index 3c8f425..7d84bec 100644
>>> --- a/src/tail.c
>>> +++ b/src/tail.c
>>> @@ -1231,7 +1231,7 @@ tail_forever_inotify (int wd, struct File_spec *f, 
>>> size_t n_files,
>>>            if (hash_insert (wd_table, &(f[i])) == NULL)
>>>              xalloc_die ();
>>>
>>> -          if (follow_mode == Follow_name || f[i].wd)
>>> +          if (follow_mode == Follow_name || 0 <= f[i].wd)
>>
>> Ten lines above that, we ensure that 0 <= f[i].wd is true,
>> so this stmt:
>>              if (follow_mode == Follow_name || 0 <= f[i].wd)
>> is equivalent to this:
>>              if (follow_mode == Follow_name || true)
>> aka,
>>              if (true)
>>
>> so perhaps that change should be larger:
>>
>> -          if (follow_mode == Follow_name || f[i].wd)
>> -            found_watchable = true;
>> +          found_watchable = true;
>>
>> Also, the initialization (farther above) of f[i].wd to a valid
>> file descriptor value (0) seems like a mistake:
>>
>> -          f[i].wd = 0;
>> +          f[i].wd = -1;
>>
>> What do you think?
>>
>
> Agreed. I'll push the attached soon.

Perfect.  Thanks.




reply via email to

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