diff options
author | Rob Landley <rob@landley.net> | 2014-10-14 14:16:34 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-10-14 14:16:34 -0500 |
commit | 784eb9c2d2cbd8ec49ff40dbaba17f4407f3b85a (patch) | |
tree | 56c9c74095322626deecff444d10f2d706a32306 /toys/other | |
parent | 1796626d9e7a4df3705ef83dbf278d248756692b (diff) | |
download | toybox-784eb9c2d2cbd8ec49ff40dbaba17f4407f3b85a.tar.gz |
Use O_CLOEXEC instead of O_RDONLY to signal loopfiles_rw() to close filehandles.
Diffstat (limited to 'toys/other')
-rw-r--r-- | toys/other/truncate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/other/truncate.c b/toys/other/truncate.c index 123ae553..d09818f3 100644 --- a/toys/other/truncate.c +++ b/toys/other/truncate.c @@ -35,6 +35,6 @@ void truncate_main(void) // Create files with mask rwrwrw. // Nonexistent files are only an error if we're supposed to create them. - loopfiles_rw(toys.optargs, O_WRONLY|(cr ? O_CREAT : 0), 0666, cr, + loopfiles_rw(toys.optargs, O_WRONLY|O_CLOEXEC|(cr ? O_CREAT : 0), 0666, cr, do_truncate); } |