mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Tools: hv: Handle the case when the target file exists correctly
Return the appropriate error code and handle the case when the target file exists correctly. This fixes a bug. Signed-off-by: K. Y. Srinivasan <[email protected]> Cc: <[email protected]> [3.14] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
177581faf2
commit
314672a2c2
2 changed files with 4 additions and 1 deletions
|
|
@ -82,8 +82,10 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
|
|||
|
||||
if (!access(target_fname, F_OK)) {
|
||||
syslog(LOG_INFO, "File: %s exists", target_fname);
|
||||
if (!smsg->copy_flags & OVER_WRITE)
|
||||
if (!(smsg->copy_flags & OVER_WRITE)) {
|
||||
error = HV_ERROR_ALREADY_EXISTS;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744);
|
||||
|
|
|
|||
Loading…
Reference in a new issue