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 <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/9495
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
Kotresh HR 2015-01-27 17:42:53 +05:30 committed by Venky Shankar
parent 6b22f5ba83
commit ee3d92e83c

View File

@ -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)