brctl: fix parsing of timespec to allow 0 (setfd, sethello..)

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Maciek Borzecki 2010-03-16 12:41:29 +01:00 committed by Denys Vlasenko
parent 8d4a8d195d
commit 46abfc0da1

View File

@ -48,8 +48,9 @@ static ALWAYS_INLINE void strtotimeval(struct timeval *tv,
{
double secs;
#if BRCTL_USE_INTERNAL
secs = /*bb_*/strtod(time_str, NULL);
if (!secs)
char *endptr;
secs = /*bb_*/strtod(time_str, &endptr);
if (endptr == time_str)
#else
if (sscanf(time_str, "%lf", &secs) != 1)
#endif