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:
Zbigniew Jędrzejewski-Szmek
2013-03-29 10:12:41 -04:00
parent 0db809489f
commit 8333c77edf
12 changed files with 18 additions and 18 deletions
+2 -2
View File
@@ -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);