Sometimes errno was overwritten and in switch return different values that was
assigned in lstat. This caused issue in throwing errors (IO instead Not Found)
[Verification] Code compiles without error. TCT passrate 100%
Change-Id: I79fc23cdd4c9113cab56d42cee6b5df82ed632a1
Signed-off-by: Lukasz Bardeli <l.bardeli@AMDC967.digital.local>
struct stat syminfo;
if (lstat(path->getFullPath().c_str(), &info) != 0) {
- LoggerE("File:[%s] error no:%d", path->getFullPath().c_str(), errno);
+ int tmp_errno = errno;
+ LoggerE("File: [%s] error no: %d", path->getFullPath().c_str(), tmp_errno);
- switch (errno) {
+ switch (tmp_errno) {
case EACCES:
SLoggerE("File: [%s]", path->getFullPath().c_str());
return LogAndCreateResult(ErrorCode::INVALID_VALUES_ERR, "Node access denied");