From a1801237a8135cc277eb0748e6dbcf2c58d3e2bf Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Mon, 13 Jul 2015 19:35:38 +0300 Subject: [PATCH] Fixed error messages being printed for existing directories. --- server/core/service.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/server/core/service.c b/server/core/service.c index 4e36708f8..84e6f9b13 100644 --- a/server/core/service.c +++ b/server/core/service.c @@ -278,10 +278,13 @@ GWPROTOCOL *funcs; if(mkdir_rval) { - skygw_log_write(LOGFILE_ERROR,"Error : Failed to create directory '%s': [%d] %s", - path, - errno, - strerror(errno)); + if(errno != EEXIST) + { + skygw_log_write(LOGFILE_ERROR,"Error : Failed to create directory '%s': [%d] %s", + path, + errno, + strerror(errno)); + } mkdir_rval = 0; } @@ -293,10 +296,13 @@ GWPROTOCOL *funcs; if(mkdir_rval) { - skygw_log_write(LOGFILE_ERROR,"Error : Failed to create directory '%s': [%d] %s", - path, - errno, - strerror(errno)); + if(errno != EEXIST) + { + skygw_log_write(LOGFILE_ERROR,"Error : Failed to create directory '%s': [%d] %s", + path, + errno, + strerror(errno)); + } mkdir_rval = 0; } strncat(path, "/dbusers", PATH_MAX);