Skip to content

Commit

Permalink
Fix: dnf_move_recursive() for file in fallback mode
Browse files Browse the repository at this point in the history
The dnf_move_recursive() had problem with moving a file in the fallback
mode. The file was copied but removing of its source failed.
The dnf_remove_recursive_v2() is used now to resolve the issue.

Related to https://bugzilla.redhat.com/show_bug.cgi?id=1700341

Closes: #789
Approved by: m-blaha
  • Loading branch information
jrohel authored and rh-atomic-bot committed Sep 5, 2019
1 parent 0645424 commit f8a9b95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libdnf/hy-iutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ dnf_copy_recursive(const std::string & srcPath, const std::string & dstPath, GEr
* @dst_dir: A destination directory path
* @error: A #GError, or %NULL
*
* Moves a directory and its contents. Native move is preferred,
* Moves a file or a directory and its contents. Native move is preferred,
* if not supported copy and delete fallback is used.
*
* Returns: %TRUE on successful move, %FALSE otherwise
Expand All @@ -430,7 +430,7 @@ dnf_move_recursive(const char * srcDir, const char * dstDir, GError ** error)
if (rename(srcDir, dstDir) == -1) {
if (!dnf_copy_recursive(srcDir, dstDir, error))
return FALSE;
return dnf_remove_recursive(srcDir, error);
return dnf_remove_recursive_v2(srcDir, error);
}
return TRUE;
}
Expand Down

0 comments on commit f8a9b95

Please sign in to comment.