diff options
Diffstat (limited to 'toys')
-rw-r--r-- | toys/other/truncate.c | 2 | ||||
-rw-r--r-- | toys/posix/cmp.c | 2 |
2 files changed, 2 insertions, 2 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); } diff --git a/toys/posix/cmp.c b/toys/posix/cmp.c index 13990d45..2dae1138 100644 --- a/toys/posix/cmp.c +++ b/toys/posix/cmp.c @@ -79,6 +79,6 @@ out: void cmp_main(void) { - loopfiles_rw(toys.optargs, O_RDONLY, 0, toys.optflags&FLAG_s, do_cmp); + loopfiles_rw(toys.optargs, O_CLOEXEC, 0, toys.optflags&FLAG_s, do_cmp); } |