tuncate file in write file command

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
This commit is contained in:
Gao feng
2015-09-28 17:30:41 +08:00
parent 68b31dddd5
commit 788e80ce39
+1 -1
View File
@@ -791,7 +791,7 @@ static int hyper_cmd_write_file(char *json, int length)
goto exit;
}
fd = open(writter.file, O_CREAT| O_WRONLY, 0644);
fd = open(writter.file, O_CREAT| O_TRUNC| O_WRONLY, 0644);
if (fd < 0) {
perror("fail to open target file");
goto exit;