projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c05387d
)
sort: -o FILE should create/truncate FILE
author
Denys Vlasenko
<vda.linux@googlemail.com>
Mon, 18 Oct 2010 00:43:57 +0000
(
02:43
+0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Mon, 18 Oct 2010 00:43:57 +0000
(
02:43
+0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/sort.c
patch
|
blob
|
history
diff --git
a/coreutils/sort.c
b/coreutils/sort.c
index 7168243217e56e0078e7db1e90c4fc28d383a4d5..eccc2d437597ee6854364c9504e906f2ec2f7f6e 100644
(file)
--- a/
coreutils/sort.c
+++ b/
coreutils/sort.c
@@
-412,7
+412,7
@@
int sort_main(int argc UNUSED_PARAM, char **argv)
#if ENABLE_FEATURE_SORT_BIG
/* Open output file _after_ we read all input ones */
if (option_mask32 & FLAG_o)
- xmove_fd(xopen(str_o, O_WRONLY), STDOUT_FILENO);
+ xmove_fd(xopen(str_o, O_WRONLY
|O_CREAT|O_TRUNC
), STDOUT_FILENO);
#endif
flag = (option_mask32 & FLAG_z) ? '\0' : '\n';
for (i = 0; i < linecount; i++)