summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-28 09:24:15 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-29 10:12:41 -0400
commit8333c77edf8fd1654cd96f3f6ee0f078dd64b58b (patch)
tree135da27f10763e512868c34155891864877f6622 /src/systemctl
parent0db809489fd88a320ae1023ffe36a9965e9a91b2 (diff)
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.
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index edd136addd..f7ae47e7c7 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -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);