aboutsummaryrefslogtreecommitdiff
path: root/toys/other
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-09-05 00:55:24 -0500
committerRob Landley <rob@landley.net>2016-09-05 00:55:24 -0500
commiteed9ed41aa73023af8f79cd5353b96b80585490f (patch)
tree9b1a36022b0748b06224c48239d0c0e2ebbefddc /toys/other
parent7f7907f53ecaeabb00929feb0ede85a456683ddc (diff)
downloadtoybox-eed9ed41aa73023af8f79cd5353b96b80585490f.tar.gz
Replace loopfiles' failok with WARN_ONLY open flag.
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);
}