From eed9ed41aa73023af8f79cd5353b96b80585490f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 5 Sep 2016 00:55:24 -0500 Subject: Replace loopfiles' failok with WARN_ONLY open flag. --- toys/other/fsync.c | 4 ++-- toys/other/truncate.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'toys/other') 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); } -- cgit v1.2.3