git » libfiu » commit ba2ae97

libfiu: Do not abort if mkfifo() fails with EEXIST

author Alberto Bertogli
2009-07-23 15:23:18 UTC
committer Alberto Bertogli
2009-07-23 17:53:37 UTC
parent a91be3eb0e0ad2fc891ae5d91151d3a821414eb4

libfiu: Do not abort if mkfifo() fails with EEXIST

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libfiu/fiu-rc.c +2 -2

diff --git a/libfiu/fiu-rc.c b/libfiu/fiu-rc.c
index 92ef78c..805021b 100644
--- a/libfiu/fiu-rc.c
+++ b/libfiu/fiu-rc.c
@@ -235,12 +235,12 @@ static int _fiu_rc_fifo(const char *basename)
 	snprintf(npipe_path_in, PATH_MAX, "%s-%d.in", basename, getpid());
 	snprintf(npipe_path_out, PATH_MAX, "%s-%d.out", basename, getpid());
 
-	if (mkfifo(npipe_path_in, 0600) != 0) {
+	if (mkfifo(npipe_path_in, 0600) != 0 && errno != EEXIST) {
 		rec_count--;
 		return -1;
 	}
 
-	if (mkfifo(npipe_path_out, 0600) != 0) {
+	if (mkfifo(npipe_path_out, 0600) != 0 && errno != EEXIST) {
 		unlink(npipe_path_in);
 		rec_count--;
 		return -1;