diff options
-rw-r--r-- | include/uapi/linux/hyperv.h | 1 | ||||
-rw-r--r-- | tools/hv/hv_fcopy_daemon.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/include/uapi/linux/hyperv.h b/include/uapi/linux/hyperv.h index 9beb7c991638..78e4a86030dd 100644 --- a/include/uapi/linux/hyperv.h +++ b/include/uapi/linux/hyperv.h | |||
@@ -305,6 +305,7 @@ enum hv_kvp_exchg_pool { | |||
305 | #define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F | 305 | #define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F |
306 | #define HV_INVALIDARG 0x80070057 | 306 | #define HV_INVALIDARG 0x80070057 |
307 | #define HV_GUID_NOTFOUND 0x80041002 | 307 | #define HV_GUID_NOTFOUND 0x80041002 |
308 | #define HV_ERROR_ALREADY_EXISTS 0x80070050 | ||
308 | 309 | ||
309 | #define ADDR_FAMILY_NONE 0x00 | 310 | #define ADDR_FAMILY_NONE 0x00 |
310 | #define ADDR_FAMILY_IPV4 0x01 | 311 | #define ADDR_FAMILY_IPV4 0x01 |
diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c index 4ecc4fd0bc1b..fba1c75aa484 100644 --- a/tools/hv/hv_fcopy_daemon.c +++ b/tools/hv/hv_fcopy_daemon.c | |||
@@ -82,8 +82,10 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg) | |||
82 | 82 | ||
83 | if (!access(target_fname, F_OK)) { | 83 | if (!access(target_fname, F_OK)) { |
84 | syslog(LOG_INFO, "File: %s exists", target_fname); | 84 | syslog(LOG_INFO, "File: %s exists", target_fname); |
85 | if (!smsg->copy_flags & OVER_WRITE) | 85 | if (!(smsg->copy_flags & OVER_WRITE)) { |
86 | error = HV_ERROR_ALREADY_EXISTS; | ||
86 | goto done; | 87 | goto done; |
88 | } | ||
87 | } | 89 | } |
88 | 90 | ||
89 | target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744); | 91 | target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744); |