Refuse to init when agent is running

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët 2020-05-27 14:15:07 +02:00
parent e76d8c1edb
commit 73c0b58b2f

View file

@ -329,6 +329,8 @@ s_init(int argc, char **argv, void *data)
printf("Usage: %s\n", argv[0]);
return 0;
}
if (getenv(S_ENV_AGENT))
s_fatal("Agent is running...");
int fd = open(s.path, O_RDWR | O_CREAT | O_EXCL, 0600);