From ee3d92e83c64b654b42c9ecc5b0cc3ad80a1d51b Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Tue, 27 Jan 2015 17:42:53 +0530 Subject: feature/changelog: Fix changelog and history scan failure. Fixes bad file descriptor issue while cleaning up scratch directory during gf_changelog_register. Change-Id: Ia6aa8d55dcc2209144b48b6583681a155d919c42 BUG: 1162057 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/9495 Tested-by: Gluster Build System Reviewed-by: Venky Shankar Tested-by: Venky Shankar --- xlators/features/changelog/lib/src/gf-changelog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'xlators/features/changelog') diff --git a/xlators/features/changelog/lib/src/gf-changelog.c b/xlators/features/changelog/lib/src/gf-changelog.c index a2257a66930..18eeac3e1a4 100644 --- a/xlators/features/changelog/lib/src/gf-changelog.c +++ b/xlators/features/changelog/lib/src/gf-changelog.c @@ -118,11 +118,12 @@ gf_changelog_open_dirs (gf_changelog_t *gfc) gfc->gfc_working_dir); ret = recursive_rmdir (gfc->gfc_current_dir); - if (ret) + if (ret) { gf_log (this->name, GF_LOG_ERROR, "Failed to rmdir: %s, err: %s", gfc->gfc_current_dir, strerror (errno)); goto out; + } ret = mkdir_p (gfc->gfc_current_dir, 0600, _gf_false); if (ret) @@ -141,11 +142,12 @@ gf_changelog_open_dirs (gf_changelog_t *gfc) gfc->gfc_working_dir); ret = recursive_rmdir (gfc->gfc_processing_dir); - if (ret) + if (ret) { gf_log (this->name, GF_LOG_ERROR, "Failed to rmdir: %s, err: %s", gfc->gfc_processing_dir, strerror (errno)); goto out; + } ret = mkdir_p (gfc->gfc_processing_dir, 0600, _gf_false); if (ret) -- cgit