Always use errno > 0 to help gcc
gcc thinks that errno might be negative, and functions could return something positive on error (-errno). Should not matter in practice, but makes an -O4 build much quieter.
This commit is contained in:
@@ -4629,11 +4629,11 @@ static int parse_time_spec(const char *t, usec_t *_u) {
|
||||
|
||||
errno = 0;
|
||||
hour = strtol(t, &e, 10);
|
||||
if (errno != 0 || *e != ':' || hour < 0 || hour > 23)
|
||||
if (errno > 0 || *e != ':' || hour < 0 || hour > 23)
|
||||
return -EINVAL;
|
||||
|
||||
minute = strtol(e+1, &e, 10);
|
||||
if (errno != 0 || *e != 0 || minute < 0 || minute > 59)
|
||||
if (errno > 0 || *e != 0 || minute < 0 || minute > 59)
|
||||
return -EINVAL;
|
||||
|
||||
n = now(CLOCK_REALTIME);
|
||||
|
||||
Reference in New Issue
Block a user