Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d0b21f4 authored by Tom Zhu's avatar Tom Zhu Committed by Android Git Automerger
Browse files

am 4833d9f4: init: builtins: trancate target file in do_copy

Merge commit '4833d9f4' into eclair-plus-aosp

* commit '4833d9f4':
  init: builtins: trancate target file in do_copy
parents a39840b0 4833d9f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)))