From: Zbigniew Kostrzewa Date: Mon, 7 Oct 2013 08:41:53 +0000 (+0200) Subject: Fix Prevent issue X-Git-Tag: 2.2.1_release~7^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e25356ec10378053b2cee14ebfaf41c0b211e471;p=framework%2Fweb%2Fwrt-installer.git Fix Prevent issue [Issue#] CID: 30986 [Problem] Unchecked return value [Cause] Returned value from a function is not checked [Solution] Check return value [Verification] Build repository Change-Id: I512a0848ea5325bf1a7a8d6aa487346f486e19ee --- diff --git a/src/jobs/widget_install/directory_api.cpp b/src/jobs/widget_install/directory_api.cpp index 9ca0980..806e078 100644 --- a/src/jobs/widget_install/directory_api.cpp +++ b/src/jobs/widget_install/directory_api.cpp @@ -20,6 +20,7 @@ * @brief directory api - implementation file */ +#include #include #include #include @@ -27,6 +28,8 @@ #include #include #include +#include +#include namespace DirectoryApi { bool DirectoryCopy(std::string source, std::string dest) @@ -72,7 +75,13 @@ bool DirectoryCopy(std::string source, std::string dest) outfile.close(); infile.close(); - chown(destFile.c_str(), statInfo.st_uid, statInfo.st_gid); + errno = 0 + if (-1 == TEMP_FAILURE_RETRY(chown(destFile.c_str(), + statInfo.st_uid, + statInfo.st_gid))) { + int error = errno; + _E("Failed to change owner [%s]", DPL::GetErrnoString(error).c_str()); + } } } while (dEntryResult != NULL && return_code == 0); closedir(dir);