about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2023-12-25 18:43:50 +0100
committerLeah Neukirchen <leah@vuxu.org>2023-12-25 18:43:58 +0100
commit23493352aca66c369d0f77dd3858c0c4340765ae (patch)
tree0436b8fa3e8fbd278a245feabfec971fc7755ab8
parent96da54bb23f520def7f7f6d38ec45d90c77fcd06 (diff)
downloadnitro-23493352aca66c369d0f77dd3858c0c4340765ae.tar.gz
nitro-23493352aca66c369d0f77dd3858c0c4340765ae.tar.xz
nitro-23493352aca66c369d0f77dd3858c0c4340765ae.zip
ensure notifydir works
-rw-r--r--nitro.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/nitro.c b/nitro.c
index eeaa308..0942355 100644
--- a/nitro.c
+++ b/nitro.c
@@ -766,7 +766,12 @@ open_control_socket() {
 		strcat(notifypath, "/notify/");
 		mkdir(notifypath, 0700);
 		// ignore errors
+
 		notifydir = opendir(notifypath);
+		if (!notifydir) {
+			dprintf(2, "- nitro: could not create notify dir %s: %s\n", notifypath, strerror(errno));
+			exit(111);
+		}
 	}
 
 	struct sockaddr_un addr = { 0 };
@@ -793,9 +798,6 @@ open_control_socket() {
 void
 notify(int i)
 {
-	if (!notifydir)
-		return;
-
 	char notifybuf[128];
 	sprintf(notifybuf, "%c%s\n", 64 + services[i].state,
 	    services[i].name);