am 4d0b21f4: am 4833d9f4: init: builtins: trancate target file in do_copy
Merge commit '4d0b21f4ac5908f695c9c0759c3a34511d8fd97b' * commit '4d0b21f4ac5908f695c9c0759c3a34511d8fd97b': init: builtins: trancate target file in do_copy
This commit is contained in:
commit
cad5c9ad4b
|
@ -459,7 +459,7 @@ int do_copy(int nargs, char **args)
|
|||
if ((fd1 = open(args[1], O_RDONLY)) < 0)
|
||||
goto out_err;
|
||||
|
||||
if ((fd2 = open(args[2], O_WRONLY|O_CREAT, 0660)) < 0)
|
||||
if ((fd2 = open(args[2], O_WRONLY|O_CREAT|O_TRUNC, 0660)) < 0)
|
||||
goto out_err;
|
||||
|
||||
if (!(buffer = malloc(info.st_size)))
|
||||
|
|
Loading…
Reference in New Issue