Skip to content
Snippets Groups Projects
Commit 9646c4ff authored by Ruben Otto's avatar Ruben Otto :crab:
Browse files

feat: reuse pipe if pipe already exists, but lockfile doesn't

parent 4c912f70
Branches
No related tags found
No related merge requests found
......@@ -39,9 +39,13 @@ int receive_init(receive_t* receive) {
return -1;
}
/* create the fifo file or reuses the existing one, if existing */
if (mkfifo(DAEMON_PIPE_NAME, 0666) != 0) {
struct stat file_stat;
if (stat(DAEMON_PIPE_NAME, &file_stat) < 0 || !S_ISFIFO(file_stat.st_mode)) {
return -1;
}
}
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment