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/truncate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toys/other/truncate.c') 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