chiark / gitweb /
Always use errno > 0 to help gcc
[elogind.git] / src / systemctl / systemctl.c
index 84b7c8ee2d9a7716d5fc4dc096f7d4164f5c44b6..f7ae47e7c7a2220e2d536a9d0af9489236577207 100644 (file)
@@ -2053,7 +2053,7 @@ static int set_cgroup_attr(DBusConnection *bus, char **args) {
 }
 
 static int get_cgroup_attr(DBusConnection *bus, char **args) {
-        _cleanup_dbus_message_unref_ DBusMessage *m = NULL, *reply = NULL;
+        _cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
         _cleanup_free_ char *n = NULL;
         char **argument;
         int r;
@@ -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);
@@ -4918,7 +4918,7 @@ static int parse_argv(int argc, char *argv[]) {
                                  * request to it. For now we simply
                                  * guess that it is Upstart. */
 
-                                execv("/lib/upstart/telinit", argv);
+                                execv(TELINIT, argv);
 
                                 log_error("Couldn't find an alternative telinit implementation to spawn.");
                                 return -EIO;