Skip to content

Commit

Permalink
posix : unchecked return value coverity fix.
Browse files Browse the repository at this point in the history
CID   : 1124364

Change-Id: I1e16e3ff46b191ba2ea527e628c77a99a56f6c31
BUG: 789278
Signed-off-by: Manikandan Selvaganesh <[email protected]>
Reviewed-on: http://review.gluster.org/9667
Reviewed-by: Niels de Vos <[email protected]>
Reviewed-by: Kaleb KEITHLEY <[email protected]>
Tested-by: Gluster Build System <[email protected]>
Reviewed-by: Vijay Bellur <[email protected]>
  • Loading branch information
Manikandan Selvaganesh authored and vbellur committed Mar 30, 2015
1 parent 683145a commit b7d8567
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions xlators/storage/posix/src/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,9 +1734,15 @@ posix_rmdir (call_frame_t *frame, xlator_t *this,
strlen ("/") +
strlen (gfid_str) + 1);

mkdir (priv->trash_path, 0755);
sprintf (tmp_path, "%s/%s", priv->trash_path, gfid_str);
op_ret = rename (real_path, tmp_path);
op_ret = mkdir (priv->trash_path, 0755);
if (errno != EEXIST && op_ret == -1) {
gf_log (this->name, GF_LOG_ERROR,
"mkdir of %s failed: %s", priv->trash_path,
strerror (errno));
} else {
sprintf (tmp_path, "%s/%s", priv->trash_path, gfid_str);
op_ret = rename (real_path, tmp_path);
}
} else {
op_ret = rmdir (real_path);
}
Expand Down

0 comments on commit b7d8567

Please sign in to comment.