chiark / gitweb /
pam_elogind compiling
[elogind.git] / src / libsystemd / sd-bus / test-bus-chat.c
index 4a025d69ea53adfd7be007b74e92ceab0b6fe073..7f49fe90fab2a255be6fb86d6246857df77eb874 100644 (file)
@@ -19,7 +19,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <assert.h>
 #include <stdlib.h>
 #include <pthread.h>
 #include <unistd.h>
@@ -30,7 +29,6 @@
 #include "macro.h"
 
 #include "sd-bus.h"
-#include "bus-message.h"
 #include "bus-error.h"
 #include "bus-match.h"
 #include "bus-internal.h"
@@ -44,7 +42,7 @@ static int match_callback(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus
 static int object_callback(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
         int r;
 
-        assert(bus);
+        assert_se(bus);
 
         if (sd_bus_message_is_method_error(m, NULL))
                 return 0;
@@ -68,7 +66,7 @@ static int server_init(sd_bus **_bus) {
         int r;
         const char *unique;
 
-        assert(_bus);
+        assert_se(_bus);
 
         r = sd_bus_open_user(&bus);
         if (r < 0) {
@@ -76,7 +74,7 @@ static int server_init(sd_bus **_bus) {
                 goto fail;
         }
 
-        r = sd_bus_get_owner_id(bus, &id);
+        r = sd_bus_get_bus_id(bus, &id);
         if (r < 0) {
                 log_error_errno(r, "Failed to get server ID: %m");
                 goto fail;
@@ -299,7 +297,7 @@ static void* client1(void*p) {
                 goto finish;
         }
 
-        assert(streq(hello, "hello"));
+        assert_se(streq(hello, "hello"));
 
         if (pipe2(pp, O_CLOEXEC|O_NONBLOCK) < 0) {
                 log_error_errno(errno, "Failed to allocate pipe: %m");