summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
Diffstat (limited to 'src/login')
-rw-r--r--src/login/test-inhibit.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/login/test-inhibit.c b/src/login/test-inhibit.c
index 21d2339616..5379ffcaa1 100644
--- a/src/login/test-inhibit.c
+++ b/src/login/test-inhibit.c
@@ -42,11 +42,11 @@ static int inhibit(sd_bus *bus, const char *what) {
&error,
&reply,
"ssss", what, who, reason, mode);
- assert(r >= 0);
+ assert_se(r >= 0);
r = sd_bus_message_read_basic(reply, SD_BUS_TYPE_UNIX_FD, &fd);
- assert(r >= 0);
- assert(fd >= 0);
+ assert_se(r >= 0);
+ assert_se(fd >= 0);
return dup(fd);
}
@@ -67,10 +67,10 @@ static void print_inhibitors(sd_bus *bus) {
&error,
&reply,
"");
- assert(r >= 0);
+ assert_se(r >= 0);
r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "(ssssuu)");
- assert(r >= 0);
+ assert_se(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=<"UID_FMT"> pid=<"PID_FMT">\n",
@@ -78,7 +78,7 @@ static void print_inhibitors(sd_bus *bus) {
n++;
}
- assert(r >= 0);
+ assert_se(r >= 0);
printf("%u inhibitors\n", n);
}
@@ -89,16 +89,16 @@ int main(int argc, char*argv[]) {
int r;
r = sd_bus_open_system(&bus);
- assert(r >= 0);
+ assert_se(r >= 0);
print_inhibitors(bus);
fd1 = inhibit(bus, "sleep");
- assert(fd1 >= 0);
+ assert_se(fd1 >= 0);
print_inhibitors(bus);
fd2 = inhibit(bus, "idle:shutdown");
- assert(fd2 >= 0);
+ assert_se(fd2 >= 0);
print_inhibitors(bus);
safe_close(fd1);