recreating FIFO if it exists
authorMartin Willi <martin@strongswan.org>
Thu, 31 Jul 2008 09:04:54 +0000 (09:04 -0000)
committerMartin Willi <martin@strongswan.org>
Thu, 31 Jul 2008 09:04:54 +0000 (09:04 -0000)
src/charon/plugins/uci/uci_control.c

index c773bff..2ffdd2b 100644 (file)
@@ -284,8 +284,8 @@ uci_control_t *uci_control_create()
 
        this->public.destroy = (void(*)(uci_control_t*))destroy;
 
-       if (access(FIFO_FILE, F_OK) != 0 &&
-               mkfifo(FIFO_FILE, S_IRUSR|S_IWUSR) != 0)
+       unlink(FIFO_FILE);
+       if (mkfifo(FIFO_FILE, S_IRUSR|S_IWUSR) != 0)
        {
                DBG1(DBG_CFG, "creating UCI control fifo '%s' failed: %s",
                         FIFO_FILE, strerror(errno));