To be corrected to work as expected and compile.
}
}
+static void
+send_systemd_ready()
+{
+ const char *addrstr = getenv("NOTIFY_SOCKET");
+ if (addrstr) {
+ int fd = socket(AF_UNIX, SOCK_DGRAM, 0);
+ struct sockaddr_un addr = { .sun_family = AF_UNIX };
+ strncpy(addr.sun_path, sizeof(addr.sun_path), addrstr);
+ connect(fd, (struct sockaddr*) &addr);
+ write(fd, "READY=1");
+ close(fd);
+ }
+}
+
/*
* Hic Est main()
*/
dup2(0, 2);
}
+ send_systemd_ready();
+
main_thread_init();
write_pid_file();