Skip to content

Commit c33f150

Browse files
committed
notify: exit when we get Connection refused
Our connection is dead, no point in continuing.
1 parent e1c976f commit c33f150

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

notify.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ void notify(sd_bus* bus, const char* summary, const char* body)
4242
}
4343
ret = sd_bus_call(bus, m, 0, NULL, NULL);
4444
sd_bus_message_unref(m);
45-
if (ret < 0) {
45+
if (ret == -ENOTCONN) {
46+
fprintf(stderr, "fatal: sd_bus_call: %s\n", strerror(-ret));
47+
exit(FATAL_SEND_NOTIFY);
48+
} else if (ret < 0) {
4649
fprintf(stderr, "sd_bus_call: %s\n", strerror(-ret));
4750
return;
4851
}

0 commit comments

Comments
 (0)