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:
e111a16
)
truncate: use O_WRONLY|O_NONBLOCK
author
Mike Frysinger
<vapier@gentoo.org>
Wed, 13 Jan 2016 18:30:20 +0000
(13:30 -0500)
committer
Mike Frysinger
<vapier@gentoo.org>
Wed, 13 Jan 2016 18:30:20 +0000
(13:30 -0500)
This matches coreutils behavior. We don't read the fd, and truncation
does not need blocking.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
coreutils/truncate.c
patch
|
blob
|
history
diff --git
a/coreutils/truncate.c
b/coreutils/truncate.c
index 4c997bf7a26092083bc766f61845d7c460c179a1..8d845f218b939cfbe51379418890d19a92a368b1 100644
(file)
--- a/
coreutils/truncate.c
+++ b/
coreutils/truncate.c
@@
-40,7
+40,7
@@
int truncate_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int truncate_main(int argc UNUSED_PARAM, char **argv)
{
unsigned opts;
- int flags = O_
RDWR
;
+ int flags = O_
WRONLY | O_NONBLOCK
;
int ret = EXIT_SUCCESS;
char *size_str;
off_t size;