chiark / gitweb /
gcc: make a couple of gcc warnings go away
authorLennart Poettering <lennart@poettering.net>
Wed, 31 Mar 2010 18:08:05 +0000 (20:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 31 Mar 2010 18:08:05 +0000 (20:08 +0200)
device.c
job.c
service.c
socket.c
util.c

index 1b0b50f..6de7d51 100644 (file)
--- a/device.c
+++ b/device.c
@@ -186,8 +186,10 @@ static int device_process_new_device(Manager *m, struct udev_device *dev, bool u
 
         if (names) {
                 FOREACH_WORD(w, l, names, state) {
-                        if (!(e = strndup(w, l)))
+                        if (!(e = strndup(w, l))) {
+                                r = -ENOMEM;
                                 goto fail;
+                        }
 
                         r = unit_add_name(u, e);
                         free(e);
@@ -199,8 +201,10 @@ static int device_process_new_device(Manager *m, struct udev_device *dev, bool u
 
         if (wants) {
                 FOREACH_WORD(w, l, wants, state) {
-                        if (!(e = strndup(w, l)))
+                        if (!(e = strndup(w, l))) {
+                                r = -ENOMEM;
                                 goto fail;
+                        }
 
                         r = unit_add_dependency_by_name(u, UNIT_WANTS, e);
                         free(e);
diff --git a/job.c b/job.c
index be42eaf..e2354af 100644 (file)
--- a/job.c
+++ b/job.c
@@ -410,7 +410,7 @@ int job_run_and_invalidate(Job *j) {
 int job_finish_and_invalidate(Job *j, bool success) {
         Unit *u;
         Unit *other;
-        UnitType t;
+        JobType t;
         Iterator i;
 
         assert(j);
index 2841689..149a791 100644 (file)
--- a/service.c
+++ b/service.c
@@ -1436,7 +1436,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                  * don't care about failing commands. */
 
                 if (s->control_command->command_next &&
-                    (success || (s->state == SERVICE_EXEC_STOP || s->state == SERVICE_EXEC_STOP_POST)))
+                    (success || (s->state == SERVICE_STOP || s->state == SERVICE_STOP_POST)))
 
                         /* There is another command to *
                          * execute, so let's do that. */
index 7993334..afa001f 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -701,7 +701,7 @@ static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) {
         log_debug("%s control process exited, code=%s status=%i", unit_id(u), sigchld_code_to_string(code), status);
 
         if (s->control_command->command_next &&
-            (success || (s->state == SOCKET_EXEC_STOP_PRE || s->state == SOCKET_EXEC_STOP_POST))) {
+            (success || (s->state == SOCKET_STOP_PRE || s->state == SOCKET_STOP_POST))) {
                 log_debug("%s running next command for the state %s", unit_id(u), state_string_table[s->state]);
                 socket_run_next(s, success);
         } else {
diff --git a/util.c b/util.c
index d2b7312..9df6af9 100644 (file)
--- a/util.c
+++ b/util.c
@@ -903,8 +903,8 @@ char *xescape(const char *s, const char *bad) {
 
         for (f = s, t = r; *f; f++) {
 
-                if (*f < ' ' || *f >= 127 ||
-                    *f == '\\' || strchr(bad, *f)) {
+                if ((*f < ' ') || (*f >= 127) ||
+                    (*f == '\\') || strchr(bad, *f)) {
                         *(t++) = '\\';
                         *(t++) = 'x';
                         *(t++) = hexchar(*f >> 4);