summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2013-01-25 16:41:07 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-01-29 16:02:34 +0100
commitcc542ca566355d8dd71bca62e3c564243120455e (patch)
tree2cd0dee953bd5fe1e4dc26b9f4dd7c334deed5cd /src/tools
parent86a16cf3b234597c03fba52dfdfb21a623093254 (diff)
downloadsssd-cc542ca566355d8dd71bca62e3c564243120455e.tar.gz
sssd-cc542ca566355d8dd71bca62e3c564243120455e.tar.bz2
sssd-cc542ca566355d8dd71bca62e3c564243120455e.zip
Unchecked return value in files.c
Found by coverity. https://fedorahosted.org/sssd/ticket/1791
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/files.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tools/files.c b/src/tools/files.c
index 62fd0036..57261729 100644
--- a/src/tools/files.c
+++ b/src/tools/files.c
@@ -691,6 +691,7 @@ copy_dir(struct copy_ctx *cctx,
const struct stat *src_dir_stat)
{
errno_t ret;
+ errno_t dret;
int dest_dir_fd = -1;
DIR *dir = NULL;
struct dirent *ent;
@@ -779,7 +780,14 @@ copy_dir(struct copy_ctx *cctx,
ret = EOK;
done:
- if (dir) closedir(dir);
+ if (dir) {
+ dret = closedir(dir);
+ if (dret != 0) {
+ dret = errno;
+ DEBUG(SSSDBG_MINOR_FAILURE,
+ ("Failed to close directory: %s.\n", strerror(dret)));
+ }
+ }
if (dest_dir_fd != -1) {
close(dest_dir_fd);