chiark / gitweb /
Prep v236 : Add missing SPDX-License-Identifier (4/9) src/libelogind
authorSven Eden <yamakuzure@gmx.net>
Tue, 13 Mar 2018 18:12:55 +0000 (19:12 +0100)
committerSven Eden <yamakuzure@gmx.net>
Mon, 26 Mar 2018 16:25:59 +0000 (18:25 +0200)
54 files changed:
src/libelogind/libelogind.pc.in
src/libelogind/libelogind.sym
src/libelogind/sd-bus/bus-bloom.c
src/libelogind/sd-bus/bus-bloom.h
src/libelogind/sd-bus/bus-common-errors.c
src/libelogind/sd-bus/bus-common-errors.h
src/libelogind/sd-bus/bus-container.c
src/libelogind/sd-bus/bus-container.h
src/libelogind/sd-bus/bus-control.c
src/libelogind/sd-bus/bus-control.h
src/libelogind/sd-bus/bus-convenience.c
src/libelogind/sd-bus/bus-creds.c
src/libelogind/sd-bus/bus-creds.h
src/libelogind/sd-bus/bus-error.c
src/libelogind/sd-bus/bus-error.h
src/libelogind/sd-bus/bus-gvariant.c
src/libelogind/sd-bus/bus-gvariant.h
src/libelogind/sd-bus/bus-internal.c
src/libelogind/sd-bus/bus-internal.h
src/libelogind/sd-bus/bus-introspect.c
src/libelogind/sd-bus/bus-introspect.h
src/libelogind/sd-bus/bus-kernel.c
src/libelogind/sd-bus/bus-kernel.h
src/libelogind/sd-bus/bus-match.c
src/libelogind/sd-bus/bus-match.h
src/libelogind/sd-bus/bus-message.c
src/libelogind/sd-bus/bus-message.h
src/libelogind/sd-bus/bus-objects.c
src/libelogind/sd-bus/bus-objects.h
src/libelogind/sd-bus/bus-protocol.h
src/libelogind/sd-bus/bus-signature.c
src/libelogind/sd-bus/bus-signature.h
src/libelogind/sd-bus/bus-slot.c
src/libelogind/sd-bus/bus-slot.h
src/libelogind/sd-bus/bus-socket.c
src/libelogind/sd-bus/bus-socket.h
src/libelogind/sd-bus/bus-track.c
src/libelogind/sd-bus/bus-track.h
src/libelogind/sd-bus/bus-type.c
src/libelogind/sd-bus/bus-type.h
src/libelogind/sd-bus/sd-bus.c
src/libelogind/sd-bus/test-bus-error.c
src/libelogind/sd-bus/test-bus-introspect.c
src/libelogind/sd-bus/test-bus-match.c
src/libelogind/sd-bus/test-bus-server.c
src/libelogind/sd-bus/test-bus-signature.c
src/libelogind/sd-daemon/sd-daemon.c
src/libelogind/sd-event/sd-event.c
src/libelogind/sd-event/test-event.c
src/libelogind/sd-id128/id128-util.c
src/libelogind/sd-id128/id128-util.h
src/libelogind/sd-id128/sd-id128.c
src/libelogind/sd-login/sd-login.c
src/libelogind/sd-login/test-login.c

index 015cb721f49bec5a63c12b6fac7afdf71b961cd2..382a4157d00f79863ce4518b58bf8bdf1f4a88f6 100644 (file)
@@ -1,6 +1,8 @@
 #  This file is part of elogind.
+#  SPDX-License-Identifier: LGPL-2.1+
 #
 #  elogind is free software; you can redistribute it and/or modify it
+#
 #  under the terms of the GNU Lesser General Public License as published by
 #  the Free Software Foundation; either version 2.1 of the License, or
 #  (at your option) any later version.
@@ -8,7 +10,7 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@rootlibdir@
-includedir=@includedir@/elogind
+includedir=@includedir@
 
 Name: elogind
 Description: elogind Library
index bc5a53daad95c7c52f0fc0ef46c1f6d99d32fe42..c221ec07086a5338543f12f8f0ad6baeaf67214b 100644 (file)
@@ -1,4 +1,6 @@
 /***
+  SPDX-License-Identifier: LGPL-2.1+
+
   This file is part of systemd.
 
   systemd is free software; you can redistribute it and/or modify it
@@ -482,30 +484,30 @@ global:
         sd_listen_fds_with_names;
 } LIBSYSTEMD_226;
 
-/*
- * These methods are not needed by elogind.
- * LIBSYSTEMD_229 {
- * global:
- *         sd_journal_has_runtime_files;
- *         sd_journal_has_persistent_files;
- *         sd_journal_enumerate_fields;
- *         sd_journal_restart_fields;
- * } LIBSYSTEMD_227;
-*/
-/*
- * These methods are not needed by elogind.
- * LIBSYSTEMD_230 {
- * global:
- *         sd_journal_open_directory_fd;
- *         sd_journal_open_files_fd;
- * } LIBSYSTEMD_229;
-*/
-
+/** if 0 /// UNNEEDED by elogind
+  * LIBSYSTEMD_229 {
+  * global:
+  *         sd_journal_has_runtime_files;
+  *         sd_journal_has_persistent_files;
+  *         sd_journal_enumerate_fields;
+  *         sd_journal_restart_fields;
+  * } LIBSYSTEMD_227;
+  * 
+  * LIBSYSTEMD_230 {
+  * global:
+  *         sd_journal_open_directory_fd;
+  *         sd_journal_open_files_fd;
+  * } LIBSYSTEMD_229;
+ endif **/
 
 LIBSYSTEMD_231 {
 global:
         sd_event_get_iteration;
+/** if 0 /// Previous blocks unused by elogind
+  * } LIBSYSTEMD_230;
+  * else **/
 } LIBSYSTEMD_227;
+/** endif **/
 
 LIBSYSTEMD_232 {
 global:
@@ -528,3 +530,9 @@ LIBSYSTEMD_234 {
 global:
         sd_bus_message_appendv;
 } LIBSYSTEMD_233;
+
+LIBSYSTEMD_236 {
+global:
+        sd_bus_message_new;
+        sd_bus_message_seal;
+} LIBSYSTEMD_234;
index 112769fcb6d964299e94606f5a1cdb34f37b199f..ebda6516e20526270e0fd464612051cea1945951 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index c824622b95fa54e973607fe9cad22534d5143540..26507621457bbc064bfd67873a8d72d58f2c6220 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index a6d38b98256d58eccb0b43424a1035ba10cd7cbe..da67f68a723373a3f8cb2e17ac6f99b80d3b4c89 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 2a5892b0ecc98cc241fdf1dcba892462886620fe..496c882fb5af819e1f8855c7ecc588c9298d3e4e 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 9827a42267a4a6ad3e971d002d53c604ff559451..8f6d34838e2aaca3ebe64e73819dc1ed22fc3ea2 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 35952d9256bd1216f1e4c5f694e79127c79bd6f8..6921ffd52d173c95968324df199d3a680a6a414a 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index fcd4d27e07e244b10cb24369b5d2affcb4b46af5..12478e7cc68a68b20576ce302ee7173a3c78b43a 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 01c71874db861a3fc777f9cffa2bb7508bab146c..c9d434c60744d7d299b3b6125973e44589c26068 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index e171c53e21b947c5810309ac70b6fc72d93114d9..9d3b5964291f71f4a186f25f0708f093e89ccd60 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index fcc3b501686d7135a20513278e3800b7faa7192a..add32c6b2d893039d861debb87bdb4e0fab56e02 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index df8a1f1005d0c4278e1d4881902efd5024ff9e1f..c4c60fa2d7ab80518df5d2d88e9c97b2feb29143 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 378f7a377a5e150257786782621f5a6edb7f82a5..c9517499d7bb1f6ea7341a5c807a18ff78f502ca 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index e2c4cf4b3f61ae82198771f0fcada9d99a0239e1..6181e37d81f0f226453c880ba0c4914cb505e66d 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 58782767faea16fcce09e5b2f7bf8f81a971f65f..6a990a02c0485595ccba2be4bd43653f4ae8f3c5 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 6da637fb05450ce61332890374b13e03f4adf42c..474e131566d3c93e336fd52ca97789b113194c05 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index aca2225ea1d23f6bcbc3f3272453f591d7e7eec3..a53b52a985e28d881259e5e3d3431464b059c658 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 6f909aa420746e8a38fa7b933519e6ab40e883aa..96474e9a3d50184cc73d7eac084c84d546ca1e37 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 9fcb59631cdbfa2ead15a05f1db79958de0dfef0..205bcee8f080b1dfaf3933fc0eace2258544253b 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -17,6 +18,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <stdio_ext.h>
+
 #include "bus-internal.h"
 #include "bus-introspect.h"
 #include "bus-protocol.h"
@@ -36,8 +39,10 @@ int introspect_begin(struct introspect *i, bool trusted) {
         if (!i->f)
                 return -ENOMEM;
 
-        fputs_unlocked(BUS_INTROSPECT_DOCTYPE
-                       "<node>\n", i->f);
+        (void) __fsetlocking(i->f, FSETLOCKING_BYCALLER);
+
+        fputs(BUS_INTROSPECT_DOCTYPE
+              "<node>\n", i->f);
 
         return 0;
 }
@@ -45,12 +50,12 @@ int introspect_begin(struct introspect *i, bool trusted) {
 int introspect_write_default_interfaces(struct introspect *i, bool object_manager) {
         assert(i);
 
-        fputs_unlocked(BUS_INTROSPECT_INTERFACE_PEER
-                       BUS_INTROSPECT_INTERFACE_INTROSPECTABLE
-                       BUS_INTROSPECT_INTERFACE_PROPERTIES, i->f);
+        fputs(BUS_INTROSPECT_INTERFACE_PEER
+              BUS_INTROSPECT_INTERFACE_INTROSPECTABLE
+              BUS_INTROSPECT_INTERFACE_PROPERTIES, i->f);
 
         if (object_manager)
-                fputs_unlocked(BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER, i->f);
+                fputs(BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER, i->f);
 
         return 0;
 }
@@ -76,27 +81,27 @@ int introspect_write_child_nodes(struct introspect *i, Set *s, const char *prefi
 
 static void introspect_write_flags(struct introspect *i, int type, int flags) {
         if (flags & SD_BUS_VTABLE_DEPRECATED)
-                fputs_unlocked("   <annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n", i->f);
+                fputs("   <annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n", i->f);
 
         if (type == _SD_BUS_VTABLE_METHOD && (flags & SD_BUS_VTABLE_METHOD_NO_REPLY))
-                fputs_unlocked("   <annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>\n", i->f);
+                fputs("   <annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>\n", i->f);
 
         if (IN_SET(type, _SD_BUS_VTABLE_PROPERTY, _SD_BUS_VTABLE_WRITABLE_PROPERTY)) {
                 if (flags & SD_BUS_VTABLE_PROPERTY_EXPLICIT)
-                        fputs_unlocked("   <annotation name=\"org.freedesktop.systemd1.Explicit\" value=\"true\"/>\n", i->f);
+                        fputs("   <annotation name=\"org.freedesktop.elogind1.Explicit\" value=\"true\"/>\n", i->f);
 
                 if (flags & SD_BUS_VTABLE_PROPERTY_CONST)
-                        fputs_unlocked("   <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"const\"/>\n", i->f);
+                        fputs("   <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"const\"/>\n", i->f);
                 else if (flags & SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION)
-                        fputs_unlocked("   <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"invalidates\"/>\n", i->f);
+                        fputs("   <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"invalidates\"/>\n", i->f);
                 else if (!(flags & SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE))
-                        fputs_unlocked("   <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"false\"/>\n", i->f);
+                        fputs("   <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"false\"/>\n", i->f);
         }
 
         if (!i->trusted &&
             IN_SET(type, _SD_BUS_VTABLE_METHOD, _SD_BUS_VTABLE_WRITABLE_PROPERTY) &&
             !(flags & SD_BUS_VTABLE_UNPRIVILEGED))
-                fputs_unlocked("   <annotation name=\"org.freedesktop.systemd1.Privileged\" value=\"true\"/>\n", i->f);
+                fputs("   <annotation name=\"org.freedesktop.elogind1.Privileged\" value=\"true\"/>\n", i->f);
 }
 
 static int introspect_write_arguments(struct introspect *i, const char *signature, const char *direction) {
@@ -117,7 +122,7 @@ static int introspect_write_arguments(struct introspect *i, const char *signatur
                 if (direction)
                         fprintf(i->f, " direction=\"%s\"/>\n", direction);
                 else
-                        fputs_unlocked("/>\n", i->f);
+                        fputs("/>\n", i->f);
 
                 signature += l;
         }
@@ -140,7 +145,7 @@ int introspect_write_interface(struct introspect *i, const sd_bus_vtable *v) {
 
                 case _SD_BUS_VTABLE_START:
                         if (v->flags & SD_BUS_VTABLE_DEPRECATED)
-                                fputs_unlocked("  <annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n", i->f);
+                                fputs("  <annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n", i->f);
                         break;
 
                 case _SD_BUS_VTABLE_METHOD:
@@ -148,7 +153,7 @@ int introspect_write_interface(struct introspect *i, const sd_bus_vtable *v) {
                         introspect_write_arguments(i, strempty(v->x.method.signature), "in");
                         introspect_write_arguments(i, strempty(v->x.method.result), "out");
                         introspect_write_flags(i, v->type, v->flags);
-                        fputs_unlocked("  </method>\n", i->f);
+                        fputs("  </method>\n", i->f);
                         break;
 
                 case _SD_BUS_VTABLE_PROPERTY:
@@ -158,14 +163,14 @@ int introspect_write_interface(struct introspect *i, const sd_bus_vtable *v) {
                                 v->x.property.signature,
                                 v->type == _SD_BUS_VTABLE_WRITABLE_PROPERTY ? "readwrite" : "read");
                         introspect_write_flags(i, v->type, v->flags);
-                        fputs_unlocked("  </property>\n", i->f);
+                        fputs("  </property>\n", i->f);
                         break;
 
                 case _SD_BUS_VTABLE_SIGNAL:
                         fprintf(i->f, "  <signal name=\"%s\">\n", v->x.signal.member);
                         introspect_write_arguments(i, strempty(v->x.signal.signature), NULL);
                         introspect_write_flags(i, v->type, v->flags);
-                        fputs_unlocked("  </signal>\n", i->f);
+                        fputs("  </signal>\n", i->f);
                         break;
                 }
 
@@ -182,7 +187,7 @@ int introspect_finish(struct introspect *i, sd_bus *bus, sd_bus_message *m, sd_b
         assert(m);
         assert(reply);
 
-        fputs_unlocked("</node>\n", i->f);
+        fputs("</node>\n", i->f);
 
         r = fflush_and_check(i->f);
         if (r < 0)
index 8e2f3800cab54abc889ce47a573c91ce42e6a521..5d2d5a17ddd89a410f8e843744f2cc51b2b32db9 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index edb9b64608a9dfe62bee5d6d2ea10926d3ef2656..8130a47057980877205cac4d14ab665cffc02cad 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 6b984a5824dd81184fff48dd49f963fdacb46e8f..1b09c13ca27b3df67db76abecb3ad528521627ce 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 82f0f1f0df42dfbf1ea40d83436c0437bf97bc0f..bd78ccb699fa679f437a1217e60285325957d2a9 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -17,6 +18,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+//#include <stdio_ext.h>
+
 #include "alloc-util.h"
 #include "bus-internal.h"
 #include "bus-match.h"
@@ -954,22 +957,24 @@ char *bus_match_to_string(struct bus_match_component *components, unsigned n_com
         if (!f)
                 return NULL;
 
+        __fsetlocking(f, FSETLOCKING_BYCALLER);
+
         for (i = 0; i < n_components; i++) {
                 char buf[32];
 
                 if (i != 0)
-                        fputc_unlocked(',', f);
+                        fputc(',', f);
 
-                fputs_unlocked(bus_match_node_type_to_string(components[i].type, buf, sizeof(buf)), f);
-                fputc_unlocked('=', f);
-                fputc_unlocked('\'', f);
+                fputs(bus_match_node_type_to_string(components[i].type, buf, sizeof(buf)), f);
+                fputc('=', f);
+                fputc('\'', f);
 
                 if (components[i].type == BUS_MATCH_MESSAGE_TYPE)
-                        fputs_unlocked(bus_message_type_to_string(components[i].value_u8), f);
+                        fputs(bus_message_type_to_string(components[i].value_u8), f);
                 else
-                        fputs_unlocked(components[i].value_str, f);
+                        fputs(components[i].value_str, f);
 
-                fputc_unlocked('\'', f);
+                fputc('\'', f);
         }
 
         r = fflush_and_check(f);
index 9985db1338612921a5c799fa8dd3b784119471e0..baaaa719a681b9d0cbe44ba54d07de003ae2b584 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 28f5c66a1a2f178487622ed52ea1122aca444967..1f79ce99ad7299f9b890e882b193bd331c483da6 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -573,28 +574,36 @@ fail:
         return r;
 }
 
-static sd_bus_message *message_new(sd_bus *bus, uint8_t type) {
-        sd_bus_message *m;
+_public_ int sd_bus_message_new(
+                sd_bus *bus,
+                sd_bus_message **m,
+                uint8_t type) {
 
-        assert(bus);
+        sd_bus_message *t;
 
-        m = malloc0(ALIGN(sizeof(sd_bus_message)) + sizeof(struct bus_header));
-        if (!m)
-                return NULL;
+        assert_return(bus, -ENOTCONN);
+        assert_return(bus->state != BUS_UNSET, -ENOTCONN);
+        assert_return(m, -EINVAL);
+        assert_return(type < _SD_BUS_MESSAGE_TYPE_MAX, -EINVAL);
 
-        m->n_ref = 1;
-        m->header = (struct bus_header*) ((uint8_t*) m + ALIGN(sizeof(struct sd_bus_message)));
-        m->header->endian = BUS_NATIVE_ENDIAN;
-        m->header->type = type;
-        m->header->version = bus->message_version;
-        m->allow_fds = bus->can_fds || !IN_SET(bus->state, BUS_HELLO, BUS_RUNNING);
-        m->root_container.need_offsets = BUS_MESSAGE_IS_GVARIANT(m);
-        m->bus = sd_bus_ref(bus);
+        t = malloc0(ALIGN(sizeof(sd_bus_message)) + sizeof(struct bus_header));
+        if (!t)
+                return -ENOMEM;
+
+        t->n_ref = 1;
+        t->header = (struct bus_header*) ((uint8_t*) t + ALIGN(sizeof(struct sd_bus_message)));
+        t->header->endian = BUS_NATIVE_ENDIAN;
+        t->header->type = type;
+        t->header->version = bus->message_version;
+        t->allow_fds = bus->can_fds || !IN_SET(bus->state, BUS_HELLO, BUS_RUNNING);
+        t->root_container.need_offsets = BUS_MESSAGE_IS_GVARIANT(t);
+        t->bus = sd_bus_ref(bus);
 
         if (bus->allow_interactive_authorization)
-                m->header->flags |= BUS_MESSAGE_ALLOW_INTERACTIVE_AUTHORIZATION;
+                t->header->flags |= BUS_MESSAGE_ALLOW_INTERACTIVE_AUTHORIZATION;
 
-        return m;
+        *m = t;
+        return 0;
 }
 
 _public_ int sd_bus_message_new_signal(
@@ -614,10 +623,12 @@ _public_ int sd_bus_message_new_signal(
         assert_return(member_name_is_valid(member), -EINVAL);
         assert_return(m, -EINVAL);
 
-        t = message_new(bus, SD_BUS_MESSAGE_SIGNAL);
-        if (!t)
+        r = sd_bus_message_new(bus, &t, SD_BUS_MESSAGE_SIGNAL);
+        if (r < 0)
                 return -ENOMEM;
 
+        assert(t);
+
         t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED;
 
         r = message_append_field_string(t, BUS_MESSAGE_HEADER_PATH, SD_BUS_TYPE_OBJECT_PATH, path, &t->path);
@@ -657,10 +668,12 @@ _public_ int sd_bus_message_new_method_call(
         assert_return(member_name_is_valid(member), -EINVAL);
         assert_return(m, -EINVAL);
 
-        t = message_new(bus, SD_BUS_MESSAGE_METHOD_CALL);
-        if (!t)
+        r = sd_bus_message_new(bus, &t, SD_BUS_MESSAGE_METHOD_CALL);
+        if (r < 0)
                 return -ENOMEM;
 
+        assert(t);
+
         r = message_append_field_string(t, BUS_MESSAGE_HEADER_PATH, SD_BUS_TYPE_OBJECT_PATH, path, &t->path);
         if (r < 0)
                 goto fail;
@@ -694,6 +707,7 @@ static int message_new_reply(
                 sd_bus_message **m) {
 
         sd_bus_message *t;
+        uint64_t cookie;
         int r;
 
         assert_return(call, -EINVAL);
@@ -702,15 +716,18 @@ static int message_new_reply(
         assert_return(call->bus->state != BUS_UNSET, -ENOTCONN);
         assert_return(m, -EINVAL);
 
-        t = message_new(call->bus, type);
-        if (!t)
+        cookie = BUS_MESSAGE_COOKIE(call);
+        if (cookie == 0)
+                return -EOPNOTSUPP;
+
+        r = sd_bus_message_new(call->bus, &t, type);
+        if (r < 0)
                 return -ENOMEM;
 
-        t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED;
-        t->reply_cookie = BUS_MESSAGE_COOKIE(call);
-        if (t->reply_cookie == 0)
-                return -EOPNOTSUPP;
+        assert(t);
 
+        t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED;
+        t->reply_cookie = cookie;
         r = message_append_reply_cookie(t, t->reply_cookie);
         if (r < 0)
                 goto fail;
@@ -858,10 +875,12 @@ int bus_message_new_synthetic_error(
         assert(sd_bus_error_is_set(e));
         assert(m);
 
-        t = message_new(bus, SD_BUS_MESSAGE_METHOD_ERROR);
-        if (!t)
+        r = sd_bus_message_new(bus, &t, SD_BUS_MESSAGE_METHOD_ERROR);
+        if (r < 0)
                 return -ENOMEM;
 
+        assert(t);
+
         t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED;
         t->reply_cookie = cookie;
 
@@ -2857,13 +2876,13 @@ static int bus_message_close_header(sd_bus_message *m) {
         return 0;
 }
 
-int bus_message_seal(sd_bus_message *m, uint64_t cookie, usec_t timeout) {
+_public_ int sd_bus_message_seal(sd_bus_message *m, uint64_t cookie, uint64_t timeout_usec) {
         struct bus_body_part *part;
         size_t a;
         unsigned i;
         int r;
 
-        assert(m);
+        assert_return(m, -EINVAL);
 
         if (m->sealed)
                 return -EPERM;
@@ -2913,7 +2932,7 @@ int bus_message_seal(sd_bus_message *m, uint64_t cookie, usec_t timeout) {
         else
                 m->header->dbus1.serial = (uint32_t) cookie;
 
-        m->timeout = m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED ? 0 : timeout;
+        m->timeout = m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED ? 0 : timeout_usec;
 
         /* Add padding at the end of the fields part, since we know
          * the body needs to start at an 8 byte alignment. We made
@@ -5789,10 +5808,12 @@ int bus_message_remarshal(sd_bus *bus, sd_bus_message **m) {
         case SD_BUS_MESSAGE_METHOD_RETURN:
         case SD_BUS_MESSAGE_METHOD_ERROR:
 
-                n = message_new(bus, (*m)->header->type);
-                if (!n)
+                r = sd_bus_message_new(bus, &n, (*m)->header->type);
+                if (r < 0)
                         return -ENOMEM;
 
+                assert(n);
+
                 n->reply_cookie = (*m)->reply_cookie;
 
                 r = message_append_reply_cookie(n, n->reply_cookie);
@@ -5835,7 +5856,7 @@ int bus_message_remarshal(sd_bus *bus, sd_bus_message **m) {
         if (timeout == 0 && !((*m)->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED))
                 timeout = BUS_DEFAULT_TIMEOUT;
 
-        r = bus_message_seal(n, BUS_MESSAGE_COOKIE(*m), timeout);
+        r = sd_bus_message_seal(n, BUS_MESSAGE_COOKIE(*m), timeout);
         if (r < 0)
                 return r;
 
index 45f1aff6588816b8e307c2b379b55371af25f160..fd75a385fb6e61bbd18cd3d16d8194d01a362e79 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
@@ -187,7 +188,6 @@ static inline bool BUS_MESSAGE_IS_GVARIANT(sd_bus_message *m) {
         return m->header->version == 2;
 }
 
-int bus_message_seal(sd_bus_message *m, uint64_t serial, usec_t timeout);
 #if 0 /// UNNEEDED by elogind
 int bus_message_get_blob(sd_bus_message *m, void **buffer, size_t *sz);
 #endif // 0
index df4b96910183306a79454fcefc38f1e982dd8edc..121197bbcb9e2f44f9990b054595baf97bdc8c30 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -959,7 +960,7 @@ static int process_introspect(
                 if (!streq_ptr(previous_interface, c->interface)) {
 
                         if (previous_interface)
-                                fputs_unlocked(" </interface>\n", intro.f);
+                                fputs(" </interface>\n", intro.f);
 
                         fprintf(intro.f, " <interface name=\"%s\">\n", c->interface);
                 }
@@ -972,7 +973,7 @@ static int process_introspect(
         }
 
         if (previous_interface)
-                fputs_unlocked(" </interface>\n", intro.f);
+                fputs(" </interface>\n", intro.f);
 
         if (empty) {
                 /* Nothing?, let's see if we exist at all, and if not
index e0b8c534ed6dcba02b43d33e7bbae56fd9a9e809..6bffeda726d93107547961b7cbe034c4a9cc23ec 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 9d180cb284cb2e86c6b1e1141005a12e357542d0..0d5dfd94744fa8a6076ed22c69d391460f83fde1 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 7bc243494a3f940bf45260f58ec03812f0cbf121..d16461f4ae95a56171e8a373db3fdbe60a83ad54 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 1e0cd7f587d06a3e71cb7a8ceb8888b15ad9f260..a6be1844e28f039013be791a3a01eff440f64934 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 725265b331c300f428fbf4a39424d2324ed48e67..756761c3ed2bcac831347c0fdedf6fe668cf53d7 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 3b8b94dc6bc62455b21135bdfee9148e434730e4..beebaa167071230c7d4f43bd75158a97ec52a3d2 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 235fe26393ec0158a0b7ccd6a48efac7ee79a159..07a9c8affdfff03e65776da883a5a39897867187 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -231,8 +232,9 @@ static int bus_socket_auth_verify_client(sd_bus *b) {
 
         if (f)
                 b->can_fds =
-                        (f - e == strlen("\r\nAGREE_UNIX_FD")) &&
-                        memcmp(e + 2, "AGREE_UNIX_FD", strlen("AGREE_UNIX_FD")) == 0;
+                        (f - e == STRLEN("\r\nAGREE_UNIX_FD")) &&
+                        memcmp(e + 2, "AGREE_UNIX_FD",
+                               STRLEN("AGREE_UNIX_FD")) == 0;
 
         b->rbuffer_size -= (start - (char*) b->rbuffer);
         memmove(b->rbuffer, start, b->rbuffer_size);
index 684feead74322165b590f6d17a6ca386247cff5f..915a283f5add329b1a436f70065ac2aaca5dda1c 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 9d902527552d859418d93a306de77344816d902a..ab22d6e4de2e312768a2a895a7bafd65252cb9f9 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -62,7 +63,7 @@ struct sd_bus_track {
         ({                                                              \
                 char *_x;                                               \
                 size_t _l = strlen(name);                               \
-                _x = alloca(strlen(MATCH_PREFIX)+_l+strlen(MATCH_SUFFIX)+1); \
+                _x = alloca(STRLEN(MATCH_PREFIX)+_l+STRLEN(MATCH_SUFFIX)+1); \
                 strcpy(stpcpy(stpcpy(_x, MATCH_PREFIX), name), MATCH_SUFFIX); \
                 _x;                                                     \
         })
index 26bd05f5c768ad258aa6df48be495cfefd587bec..0c5636b7e090d386014a6872442774150453b524 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index 27014eed293363fe5705ac2e4fc57478a6a40209..817040b1ada8c42d3974e1edfac6f15c752efcbe 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 5c87eb5f081a837a086ab210a3d9539ada1a73d7..ae272b1e6a33521b8bc3cfe49f5e5e939d0a1fb2 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index c305e8c37d09d22e9cbf0727067b68e8723663b9..2b372e4363282dbfdf3bd8ad472a90dd24bab78b 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -1425,7 +1426,7 @@ static int bus_seal_message(sd_bus *b, sd_bus_message *m, usec_t timeout) {
         if (timeout == 0)
                 timeout = BUS_DEFAULT_TIMEOUT;
 
-        return bus_message_seal(m, ++b->cookie, timeout);
+        return sd_bus_message_seal(m, ++b->cookie, timeout);
 }
 
 static int bus_remarshal_message(sd_bus *b, sd_bus_message **m) {
@@ -1465,7 +1466,7 @@ int bus_seal_synthetic_message(sd_bus *b, sd_bus_message *m) {
          * pick a fixed, artificial one. We use (uint32_t) -1 rather
          * than (uint64_t) -1 since dbus1 only had 32bit identifiers,
          * even though kdbus can do 64bit. */
-        return bus_message_seal(m, 0xFFFFFFFFULL, 0);
+        return sd_bus_message_seal(m, 0xFFFFFFFFULL, 0);
 }
 
 static int bus_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call, size_t *idx) {
index f7c889b7ccd0409ffa20b5f0dc000e42b56795d0..296e123eccfe5857ed535dc030118751f3131317 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 4425cfae26a9a8db91f3c746477c7fcac74f9d88..8dee93676887ea132f9933dd88d848a3f54f8882 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 8fd9d03ddf90b11c69e7f74d0ba9d6d632cbfc2a..47b45647c2ed50e4a70b2e01a81af3f0d5a34fbb 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -121,7 +122,7 @@ int main(int argc, char *argv[]) {
 
         assert_se(sd_bus_message_new_signal(bus, &m, "/foo/bar", "bar.x", "waldo") >= 0);
         assert_se(sd_bus_message_append(m, "ssssas", "one", "two", "/prefix/three", "prefix.four", 3, "pi", "pa", "po") >= 0);
-        assert_se(bus_message_seal(m, 1, 0) >= 0);
+        assert_se(sd_bus_message_seal(m, 1, 0) >= 0);
 
         zero(mask);
         assert_se(bus_match_run(NULL, &root, m) == 0);
index b6272efc30b1018cfbf17a404cc7aa84151a00ae..245f5707e1fde039019aa0efd85ea815074bfcb5 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 4f4fd093bf80c846bda55ccbd70c21d373f47529..aa6160d1c9968172a8ec239c60b832103ec25bc8 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index f50075ef5e0ee3f5006b7069e57bb842ea277e54..7aad70bc6cbcdac9706aceb67d7886ae56493a72 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 2c5c2ebb4dc40a88736bda5d6b99fe62f28ccce4..a5f3e854b13065d0f10be21f393e09190915f461 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index dd0c74749018bbc406f08a0790fb49222f521610..873e93ef8bcff1c74e572c6764dafc96d71607f0 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 9fcbc71461b987e69a43c82645dd54d4c6f60041..6f6334bbe865fa5e50ab5792e64e492f1fc608a4 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index d435b976d98767a7657c8f80e5acc9aa610e7cfc..8af8abbb41591dbcd7c67cb6afefb4d6612cac40 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
index d44d75ece8278f12af6dc3430dccfbcf9b22eb5b..561bcdf4f1072e8821e951289fe3aa6f548ad9d3 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 0b406f41ccbea9d9010fd557256e686b11f69273..a7de8f1c1b9842e24e931d1b08af2276aeeeac36 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
index 3b5e50c343e47f35216abc5cd01c7b8bfe8173fa..bdd1b8909ee843fc4a1767596a5a7f02f668a418 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.