aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init/builtins.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/builtins.c b/init/builtins.c
index 1e7cb4e8..b4af700b 100644
--- a/init/builtins.c
+++ b/init/builtins.c
@@ -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)))