diff --git a/tools/corosync-keygen.c b/tools/corosync-keygen.c index b4e0f24f..c7f2e2e8 100644 --- a/tools/corosync-keygen.c +++ b/tools/corosync-keygen.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -57,8 +58,10 @@ int main (void) { exit (1); } if (mkdir (SYSCONFDIR "/ais", 0700)) { - perror ("Failed to create directory: " SYSCONFDIR "/ais"); - exit (1); + if (errno != EEXIST) { + perror ("Failed to create directory: " SYSCONFDIR "/ais"); + exit (1); + } } printf ("Gathering %lu bits for key from /dev/random.\n", (unsigned long)(sizeof (key) * 8));