Skip to content

Commit

Permalink
mfu_flist_walk: added more error messages
Browse files Browse the repository at this point in the history
Added a few error messages to places with TODO

Signed-off-by: Dalton Bohning <daltonx.bohning@intel.com>
  • Loading branch information
Dalton Bohning authored and daltonbohning committed Oct 6, 2020
1 parent 7e285fa commit 4ec7841
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/common/mfu_flist_walk.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ static void walk_getdents_create(CIRCLE_handle* handle)
mfu_file_t* mfu_file = *CURRENT_PFILE;
int status = mfu_file_lstat(path, &st, mfu_file);
if (status != 0) {
/* TODO: print error */
MFU_LOG(MFU_LOG_ERR, "Failed to stat: '%s' (errno=%d %s)",
path, errno, strerror(errno));
return;
}

Expand Down Expand Up @@ -317,16 +318,12 @@ static void walk_readdir_process_dir(const char* dir, CIRCLE_handle* handle)
st.st_mode |= S_IXUSR;
mfu_file_chmod(dir, st.st_mode, mfu_file);
dirp = mfu_file_opendir(dir, mfu_file);
if (dirp == NULL) {
if (errno == EACCES) {
MFU_LOG(MFU_LOG_ERR, "Failed to open directory with opendir: `%s' (errno=%d %s)", dir, errno, strerror(errno));
}
}
}
}

if (! dirp) {
/* TODO: print error */
MFU_LOG(MFU_LOG_ERR, "Failed to open directory with opendir: '%s' (errno=%d %s)",
dir, errno, strerror(errno));
}
else {
/* Read all directory entries */
Expand Down Expand Up @@ -381,7 +378,8 @@ static void walk_readdir_process_dir(const char* dir, CIRCLE_handle* handle)
}
}
else {
/* error */
MFU_LOG(MFU_LOG_ERR, "Failed to stat: '%s' (errno=%d %s)",
newpath, errno, strerror(errno));
}
}

Expand Down Expand Up @@ -420,7 +418,8 @@ static void walk_readdir_create(CIRCLE_handle* handle)
mfu_file_t* mfu_file = *CURRENT_PFILE;
int status = mfu_file_lstat(path, &st, mfu_file);
if (status != 0) {
/* TODO: print error */
MFU_LOG(MFU_LOG_ERR, "Failed to stat: '%s' (errno=%d %s)",
path, errno, strerror(errno));
return;
}

Expand Down Expand Up @@ -461,7 +460,8 @@ static void walk_stat_process_dir(char* dir, CIRCLE_handle* handle)
DIR* dirp = mfu_file_opendir(dir, mfu_file);

if (! dirp) {
/* TODO: print error */
MFU_LOG(MFU_LOG_ERR, "Failed to open directory with opendir: '%s' (errno=%d %s)",
dir, errno, strerror(errno));
}
else {
while (1) {
Expand Down

0 comments on commit 4ec7841

Please sign in to comment.