From 3855b4285edd91fbb5e9be5e7938c7224db87887 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 4 Jun 2009 16:12:08 +0000 Subject: [PATCH] Don't let corosync-keygen fail if /etc/ais already exists git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2207 fd59a12c-fef9-0310-b244-a6a79926bd2f --- tools/corosync-keygen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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));