[systemd-commits] 4 commits - src/core src/shared src/systemctl src/systemd

Lennart Poettering lennart at kemper.freedesktop.org
Fri Aug 10 09:13:50 PDT 2012


 src/core/shutdown.c       |    2 +-
 src/shared/dbus-common.c  |    3 ++-
 src/shared/utf8.c         |    3 ++-
 src/systemctl/systemctl.c |   11 ++++++++---
 src/systemd/sd-id128.h    |    3 +--
 5 files changed, 14 insertions(+), 8 deletions(-)

New commits:
commit c516c8d17f77a1c761447f4c40c8dfffeda2e06d
Author: Simon Peeters <peeters.simon at gmail.com>
Date:   Fri Aug 10 17:32:19 2012 +0200

    systemctl: fix issue with systemctl daemon-reexec

diff --git a/src/shared/dbus-common.c b/src/shared/dbus-common.c
index 7f0dce5..da2dc2e 100644
--- a/src/shared/dbus-common.c
+++ b/src/shared/dbus-common.c
@@ -1287,7 +1287,8 @@ int bus_method_call_with_reply(DBusConnection *bus,
         reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error);
         dbus_message_unref(m);
         if (!reply) {
-                log_error("Failed to issue method call: %s", bus_error_message(&error));
+                if (!return_error)
+                        log_error("Failed to issue method call: %s", bus_error_message(&error));
                 if (bus_error_is_no_service(&error))
                         r = -ENOENT;
                 else if (dbus_error_has_name(&error, DBUS_ERROR_ACCESS_DENIED))
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 2e0aaaa..13e0f91 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1537,11 +1537,12 @@ static int start_unit_one(
                         DBUS_TYPE_INVALID);
         free(n);
         if (r) {
-                if (r == -ENOENT && arg_action != ACTION_SYSTEMCTL ) {
+                if (r == -ENOENT && arg_action != ACTION_SYSTEMCTL )
                         /* There's always a fallback possible for
                          * legacy actions. */
                         r = -EADDRNOTAVAIL;
-                }
+                else
+                        log_error("Failed to issue method call: %s", bus_error_message(error));
                 goto finish;
         }
 
@@ -3143,6 +3144,7 @@ finish:
 static int daemon_reload(DBusConnection *bus, char **args) {
         int r;
         const char *method;
+        DBusError error;
 
         if (arg_action == ACTION_RELOAD)
                 method = "Reload";
@@ -3171,7 +3173,7 @@ static int daemon_reload(DBusConnection *bus, char **args) {
                         "org.freedesktop.systemd1.Manager",
                         method,
                         NULL,
-                        NULL,
+                        &error,
                         DBUS_TYPE_INVALID);
 
         if (r == -ENOENT && arg_action != ACTION_SYSTEMCTL)
@@ -3182,6 +3184,9 @@ static int daemon_reload(DBusConnection *bus, char **args) {
                 /* On reexecution, we expect a disconnect, not
                  * a reply */
                 r = 0;
+        else if (r)
+                log_error("Failed to issue method call: %s", bus_error_message(&error));
+        dbus_error_free(&error);
 
         return r;
 }

commit fd5b4ca11ea2b8a82343bc0db6a2f422beb305f1
Author: Dave Reisner <dreisner at archlinux.org>
Date:   Fri Aug 10 11:02:04 2012 -0400

    shared/utf8: mark char* as const
    
    Avoids compiler warning:
    
      src/shared/utf8.c: In function 'ascii_filter':
      src/shared/utf8.c:278:16: warning: assignment discards 'const' qualifier
          from pointer target type [enabled by default]

diff --git a/src/shared/utf8.c b/src/shared/utf8.c
index ea7483f..5f9f3c6 100644
--- a/src/shared/utf8.c
+++ b/src/shared/utf8.c
@@ -265,7 +265,8 @@ char *ascii_is_valid(const char *str) {
 }
 
 char *ascii_filter(const char *str) {
-        char *r, *s, *d;
+        const char *s;
+        char *r, *d;
         size_t l;
 
         assert(str);

commit 4bfa638d43c05e8db052cd55818765bb3575a405
Author: Dave Reisner <dreisner at archlinux.org>
Date:   Fri Aug 10 11:02:03 2012 -0400

    shutdown: recursively mark root as private before pivot
    
    Because root is now recursively marked as shared on bootup, we need to
    recursively mark root as private. This prevents a pivot_root failure on
    shutdown:
    
      Cannot finalize remaining file systems and devices, giving up.
      pivot failed: Invalid argument

diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 105a604..0b7cbd8 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -109,7 +109,7 @@ static int pivot_to_new_root(void) {
           It works for pivot_root, but the ref count for the root device
           is not decreasing :-/
         */
-        if (mount(NULL, "/", NULL, MS_PRIVATE, NULL) < 0) {
+        if (mount(NULL, "/", NULL, MS_REC|MS_PRIVATE, NULL) < 0) {
                 log_error("Failed to make \"/\" private mount %m");
                 return -errno;
         }

commit 8e4e8df5ea6bdb93ed67a0340ac711acc39d5193
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Aug 10 17:58:46 2012 +0200

    id128: don't use C99 bool in public headers

diff --git a/src/systemd/sd-id128.h b/src/systemd/sd-id128.h
index 7d5e6c4..27fa479 100644
--- a/src/systemd/sd-id128.h
+++ b/src/systemd/sd-id128.h
@@ -23,7 +23,6 @@
 ***/
 
 #include <inttypes.h>
-#include <stdbool.h>
 #include <string.h>
 
 #ifdef __cplusplus
@@ -60,7 +59,7 @@ int sd_id128_get_boot(sd_id128_t *ret);
 #define SD_ID128_FORMAT_STR "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
 #define SD_ID128_FORMAT_VAL(x) (x).bytes[0], (x).bytes[1], (x).bytes[2], (x).bytes[3], (x).bytes[4], (x).bytes[5], (x).bytes[6], (x).bytes[7], (x).bytes[8], (x).bytes[9], (x).bytes[10], (x).bytes[11], (x).bytes[12], (x).bytes[13], (x).bytes[14], (x).bytes[15]
 
-static inline bool sd_id128_equal(sd_id128_t a, sd_id128_t b) {
+static inline int sd_id128_equal(sd_id128_t a, sd_id128_t b) {
         return memcmp(&a, &b, 16) == 0;
 }
 



More information about the systemd-commits mailing list