add sd_notify support
This commit is contained in:
parent
b8c6374f3c
commit
906e79b03d
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
|||||||
CFLAGS = -std=gnu99 -pie -fPIC -pedantic -Wno-imports -Wunused -Wno-missing-field-initializers -Wextra -Wunreachable-code -O3
|
CFLAGS = -std=gnu99 -pie -fPIC -pedantic -Wno-imports -Wunused -Wno-missing-field-initializers -Wextra -Wunreachable-code -lsystemd -O3
|
||||||
|
|
||||||
all: wireguard-mount wireguard-resolve
|
all: wireguard-mount wireguard-resolve
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <systemd/sd-daemon.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
char mount_path[32] = {0};
|
char mount_path[32] = {0};
|
||||||
@ -11,6 +12,7 @@ int main() {
|
|||||||
perror("Error");
|
perror("Error");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
sd_notify(0, "READY=1");
|
||||||
while(1) {
|
while(1) {
|
||||||
sleep(10);
|
sleep(10);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user