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:
Tom Zhu 2009-10-01 12:18:11 -07:00 committed by Android Git Automerger
commit cad5c9ad4b
1 changed files with 1 additions and 1 deletions

View File

@ -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)))