[systemd-commits] 2 commits - src/dbus.c src/mount.c

Lennart Poettering lennart at kemper.freedesktop.org
Wed Jun 2 14:03:49 PDT 2010


 src/dbus.c  |    8 ++++----
 src/mount.c |   19 +++++++++++++++----
 2 files changed, 19 insertions(+), 8 deletions(-)

New commits:
commit a2e0f3d3948d65df01e372ede12391be93d4e155
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jun 2 23:03:39 2010 +0200

    mount: parse both parts of the mount options from /proc/self/mountinfo

diff --git a/src/mount.c b/src/mount.c
index dfe4f87..5577f16 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -1262,7 +1262,7 @@ finish:
 
 static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
         int r;
-        char *device, *path, *options, *fstype, *d, *p;
+        char *device, *path, *options, *options2, *fstype, *d, *p, *o;
 
         assert(m);
 
@@ -1271,7 +1271,7 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
         for (;;) {
                 int k;
 
-                device = path = options = fstype = d = p = NULL;
+                device = path = options = options2 = fstype = d = p = o = NULL;
 
                 if ((k = fscanf(m->proc_self_mountinfo,
                                 "%*s "       /* (1) mount id */
@@ -1284,11 +1284,13 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
                                 "- "         /* (8) seperator */
                                 "%ms "       /* (9) file system type */
                                 "%ms"        /* (10) mount source */
+                                "%ms"        /* (11) mount options 2 */
                                 "%*[^\n]",   /* some rubbish at the end */
                                 &path,
                                 &options,
                                 &fstype,
-                                &device)) != 4) {
+                                &device,
+                                &options2)) != 5) {
 
                         if (k == EOF)
                                 break;
@@ -1297,21 +1299,28 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
                         goto finish;
                 }
 
+                if (asprintf(&o, "%s,%s", options, options2) < 0) {
+                        r = -ENOMEM;
+                        goto finish;
+                }
+
                 if (!(d = cunescape(device)) ||
                     !(p = cunescape(path))) {
                         r = -ENOMEM;
                         goto finish;
                 }
 
-                if ((r = mount_add_one(m, d, p, options, fstype, true, set_flags)) < 0)
+                if ((r = mount_add_one(m, d, p, o, fstype, true, set_flags)) < 0)
                         goto finish;
 
                 free(device);
                 free(path);
                 free(options);
+                free(options2);
                 free(fstype);
                 free(d);
                 free(p);
+                free(o);
         }
 
         r = 0;
@@ -1320,9 +1329,11 @@ finish:
         free(device);
         free(path);
         free(options);
+        free(options2);
         free(fstype);
         free(d);
         free(p);
+        free(o);
 
         return r;
 }
commit a5478cd440352582ddf4192f6342d41ba80e222d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jun 2 22:18:57 2010 +0200

    dbus: hide some debug output

diff --git a/src/dbus.c b/src/dbus.c
index 7916817..65e4daa 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -343,10 +343,10 @@ static DBusHandlerResult api_bus_message_filter(DBusConnection  *connection, DBu
 
         dbus_error_init(&error);
 
-        log_debug("Got D-Bus request: %s.%s() on %s",
-                  dbus_message_get_interface(message),
-                  dbus_message_get_member(message),
-                  dbus_message_get_path(message));
+        /* log_debug("Got D-Bus request: %s.%s() on %s", */
+        /*           dbus_message_get_interface(message), */
+        /*           dbus_message_get_member(message), */
+        /*           dbus_message_get_path(message)); */
 
         if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) {
                 log_error("Warning! API D-Bus connection terminated.");


More information about the systemd-commits mailing list