aboutsummaryrefslogtreecommitdiff
path: root/toys/other
diff options
context:
space:
mode:
Diffstat (limited to 'toys/other')
-rw-r--r--toys/other/fsync.c4
-rw-r--r--toys/other/truncate.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/toys/other/fsync.c b/toys/other/fsync.c
index e6f6c8d9..bd73f398 100644
--- a/toys/other/fsync.c
+++ b/toys/other/fsync.c
@@ -28,6 +28,6 @@ static void do_fsync(int fd, char *name)
void fsync_main(void)
{
- loopfiles_rw(toys.optargs, O_RDONLY|O_NOATIME|O_NOCTTY|O_CLOEXEC,
- 0, 0, do_fsync);
+ loopfiles_rw(toys.optargs, O_RDONLY|O_NOATIME|O_NOCTTY|O_CLOEXEC|WARN_ONLY,
+ 0, do_fsync);
}
diff --git a/toys/other/truncate.c b/toys/other/truncate.c
index bfe1f10c..6092d5a9 100644
--- a/toys/other/truncate.c
+++ b/toys/other/truncate.c
@@ -53,13 +53,13 @@ static void do_truncate(int fd, char *name)
void truncate_main(void)
{
- int cr = !(toys.optflags&1);
+ int cr = !(toys.optflags&FLAG_c);
if (-1 != (TT.type = stridx("+-<>/%", *TT.s))) TT.s++;
TT.size = atolx(TT.s);
// Create files with mask rwrwrw.
// Nonexistent files are only an error if we're supposed to create them.
- loopfiles_rw(toys.optargs, O_WRONLY|O_CLOEXEC|(cr ? O_CREAT : 0), 0666, cr,
- do_truncate);
+ loopfiles_rw(toys.optargs, O_WRONLY|O_CLOEXEC|(cr ? O_CREAT|WARN_ONLY : 0),
+ 0666, do_truncate);
}