From 0990dc7fd3da818a61bdcabda0db6fd0546fbd28 Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Tue, 12 May 2020 16:07:41 +0100 Subject: [PATCH] Suppress unnecessary error output while creating system cache directory Change-Id: Iaf8e312bcd04567dea4d79b8a5d3d828c3301fa8 --- dali/internal/adaptor/common/adaptor-impl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 1b56e54..737845d 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -20,6 +20,8 @@ #include // EXTERNAL INCLUDES +#include +#include #include #include #include @@ -300,11 +302,11 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: std::string systemCachePath = GetSystemCachePath(); if( ! systemCachePath.empty() ) { - const int dir_err = system( std::string( "mkdir " + systemCachePath ).c_str() ); - if (-1 == dir_err) + const int dir_err = mkdir( systemCachePath.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH ); + if ( 0 != dir_err && errno != EEXIST ) { - printf( "Error creating system cache directory: %s!\n", systemCachePath.c_str() ); - exit(1); + DALI_LOG_ERROR( "Error creating system cache directory: %s!\n", systemCachePath.c_str() ); + exit( 1 ); } } -- 2.7.4