Skip to content
Snippets Groups Projects
Commit c2ebe8ed authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Only remove the pid file if it has our pid in it.

parent a7f6b854
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2973 passed
......@@ -1238,7 +1238,17 @@ void recycle(void* cbdata)
void cleanup(void)
{
#ifdef __unix__
FILE* pf;
if ((pf = fopen(pid_fname, "r")) != NULL) {
int fpid = -1;
if (fscanf(pf, "%d", &fpid) == 1) {
fclose(pf);
if (fpid == getpid())
unlink(pid_fname);
}
else
fclose(pf);
}
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment