[systemd-commits] 3 commits - Makefile.am man/systemd.mount.xml src/login

Kay Sievers kay at kemper.freedesktop.org
Tue Nov 5 21:40:55 CET 2013


 Makefile.am              |   15 -------
 man/systemd.mount.xml    |    2 
 src/login/test-inhibit.c |  100 +++++++++++++++++------------------------------
 3 files changed, 39 insertions(+), 78 deletions(-)

New commits:
commit d91ed6423b738e4707defff7284fc65088368bfd
Author: Kay Sievers <kay at vrfy.org>
Date:   Tue Nov 5 21:35:20 2013 +0100

    build-sys: remove CFLAGS default assignment

diff --git a/Makefile.am b/Makefile.am
index bc67063..ed61884 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3520,9 +3520,6 @@ SYSTEM_UNIT_ALIASES += \
 hostnamectl_SOURCES = \
 	src/hostname/hostnamectl.c
 
-hostnamectl_CFLAGS = \
-	$(AM_CFLAGS)
-
 hostnamectl_LDADD = \
 	libsystemd-shared.la \
 	libsystemd-bus.la \
@@ -3773,9 +3770,6 @@ systemd_logind_SOURCES = \
 nodist_systemd_logind_SOURCES = \
 	src/login/logind-gperf.c
 
-systemd_logind_CFLAGS = \
-	$(libsystemd_logind_core_la_CFLAGS)
-
 systemd_logind_LDADD = \
 	libsystemd-logind-core.la \
 	$(libsystemd_logind_core_la_LIBADD)
@@ -3806,9 +3800,6 @@ libsystemd_logind_core_la_SOURCES = \
 	src/login/login-shared.c \
 	src/login/login-shared.h
 
-libsystemd_logind_core_la_CFLAGS = \
-	$(AM_CFLAGS)
-
 libsystemd_logind_core_la_LIBADD = \
 	libsystemd-label.la \
 	libsystemd-audit.la \

commit 97169d6cad5d999a788274034d8696a58ea1b248
Author: Kay Sievers <kay at vrfy.org>
Date:   Tue Nov 5 21:34:50 2013 +0100

    man: do not use <term> in <para>
    
    Element term in namespace '' encountered in para, but no template matches.

diff --git a/man/systemd.mount.xml b/man/systemd.mount.xml
index bed2975..daf1189 100644
--- a/man/systemd.mount.xml
+++ b/man/systemd.mount.xml
@@ -261,7 +261,7 @@
                                 a time span value such as "5min
                                 20s". Pass 0 to disable the timeout
                                 logic. Default value is setted up in manager configuration
-                                file via <term><varname>DefaultTimeoutStart=</varname></term>.</para></listitem>
+                                file via <varname>DefaultTimeoutStart=</varname>.</para></listitem>
                         </varlistentry>
                 </variablelist>
 

commit 997d4ae7f2d59c2f624f0856e70d448c4f98bc96
Author: Kay Sievers <kay at vrfy.org>
Date:   Tue Nov 5 20:58:18 2013 +0100

    login: port test-inhibit to libsystemd-bus

diff --git a/Makefile.am b/Makefile.am
index e29439d..bc67063 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3895,11 +3895,7 @@ test_inhibit_SOURCES = \
 
 test_inhibit_LDADD = \
 	libsystemd-shared.la \
-	libsystemd-dbus.la
-
-test_inhibit_CFLAGS = \
-	$(AM_CFLAGS) \
-	$(DBUS_CFLAGS)
+	libsystemd-bus.la
 
 test_login_tables_SOURCES = \
 	src/login/test-login-tables.c
diff --git a/src/login/test-inhibit.c b/src/login/test-inhibit.c
index 7b6deff..70b8314 100644
--- a/src/login/test-inhibit.c
+++ b/src/login/test-inhibit.c
@@ -21,101 +21,75 @@
 
 #include <unistd.h>
 
-#include <dbus/dbus.h>
-
 #include "macro.h"
 #include "util.h"
-#include "dbus-common.h"
+#include "sd-bus.h"
+#include "bus-util.h"
+#include "bus-error.h"
 
-static int inhibit(DBusConnection *bus, const char *what) {
-        DBusMessage *m, *reply;
-        DBusError error;
+static int inhibit(sd_bus *bus, const char *what) {
+        _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
+        _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         const char *who = "Test Tool", *reason = "Just because!", *mode = "block";
         int fd;
+        int r;
 
-        dbus_error_init(&error);
-
-        m = dbus_message_new_method_call(
+        r = sd_bus_call_method(bus,
                         "org.freedesktop.login1",
                         "/org/freedesktop/login1",
                         "org.freedesktop.login1.Manager",
-                        "Inhibit");
-        assert(m);
-
-        assert_se(dbus_message_append_args(m,
-                                           DBUS_TYPE_STRING, &what,
-                                           DBUS_TYPE_STRING, &who,
-                                           DBUS_TYPE_STRING, &reason,
-                                           DBUS_TYPE_STRING, &mode,
-                                           DBUS_TYPE_INVALID));
+                        "Inhibit",
+                        &error,
+                        &reply,
+                        "ssss", what, who, reason, mode);
+        assert(r >= 0);
 
-        reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error);
-        assert(reply);
+        r = sd_bus_message_read_basic(reply, SD_BUS_TYPE_UNIX_FD, &fd);
+        assert(r >= 0);
+        assert(fd >= 0);
 
-        assert(dbus_message_get_args(reply, &error,
-                                     DBUS_TYPE_UNIX_FD, &fd,
-                                     DBUS_TYPE_INVALID));
-
-        dbus_message_unref(m);
-        dbus_message_unref(reply);
-
-        return fd;
+        return dup(fd);
 }
 
-static void print_inhibitors(DBusConnection *bus) {
-        DBusMessage *m, *reply;
-        DBusError error;
+static void print_inhibitors(sd_bus *bus) {
+        _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
+        _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+        const char *what, *who, *why, *mode;
+        uint32_t uid, pid;
         unsigned n = 0;
-        DBusMessageIter iter, sub, sub2;
-
-        dbus_error_init(&error);
+        int r;
 
-        m = dbus_message_new_method_call(
+        r = sd_bus_call_method(bus,
                         "org.freedesktop.login1",
                         "/org/freedesktop/login1",
                         "org.freedesktop.login1.Manager",
-                        "ListInhibitors");
-        assert(m);
+                        "ListInhibitors",
+                        &error,
+                        &reply,
+                        "");
+        assert(r >= 0);
 
-        reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error);
-        assert(reply);
-
-        assert(dbus_message_iter_init(reply, &iter));
-        dbus_message_iter_recurse(&iter, &sub);
-
-        while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
-                const char *what, *who, *why, *mode;
-                dbus_uint32_t uid, pid;
-
-                dbus_message_iter_recurse(&sub, &sub2);
-
-                assert_se(bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &what, true) >= 0);
-                assert_se(bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &who, true) >= 0);
-                assert_se(bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &why, true) >= 0);
-                assert_se(bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &mode, true) >= 0);
-                assert_se(bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_UINT32, &uid, true) >= 0);
-                assert_se(bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_UINT32, &pid, false) >= 0);
+        r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "(ssssuu)");
+        assert(r >= 0);
 
+        while ((r = sd_bus_message_read(reply, "(ssssuu)", &what, &who, &why, &mode, &uid, &pid)) > 0) {
                 printf("what=<%s> who=<%s> why=<%s> mode=<%s> uid=<%lu> pid=<%lu>\n",
                        what, who, why, mode, (unsigned long) uid, (unsigned long) pid);
 
-                dbus_message_iter_next(&sub);
-
                 n++;
         }
+        assert(r >= 0);
 
         printf("%u inhibitors\n", n);
-
-        dbus_message_unref(m);
-        dbus_message_unref(reply);
 }
 
 int main(int argc, char*argv[]) {
-        DBusConnection *bus;
+        _cleanup_bus_unref_ sd_bus *bus = NULL;
         int fd1, fd2;
+        int r;
 
-        bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, NULL);
-        assert(bus);
+        r = sd_bus_open_system(&bus);
+        assert(r >= 0);
 
         print_inhibitors(bus);
 



More information about the systemd-commits mailing list