aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-07-24 19:58:59 -0500
committerRob Landley <rob@landley.net>2015-07-24 19:58:59 -0500
commitd073e1c0aa17f36fe28338a0787e6b07cc463a1d (patch)
tree32e17e7e30d4ca7ccb1bf7ea2b4f159de0ec7826 /toys/pending
parentb9fb3067822c0a347905db81af0496743733fad5 (diff)
downloadtoybox-d073e1c0aa17f36fe28338a0787e6b07cc463a1d.tar.gz
Promote fsync.
Diffstat (limited to 'toys/pending')
-rw-r--r--toys/pending/fsync.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/toys/pending/fsync.c b/toys/pending/fsync.c
deleted file mode 100644
index bf673df1..00000000
--- a/toys/pending/fsync.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* fsync.c - Synchronize a file's in-core state with storage device.
- *
- * Copyright 2015 Ranjan Kumar <ranjankumar.bth@gmail.comi>
- *
- * No Standard.
-
-USE_FSYNC(NEWTOY(fsync, "<1d", TOYFLAG_BIN))
-
-config FSYNC
- bool "fsync"
- default n
- help
- usage: fsync [d] [FILE...]
-
- Synchronize a file's in-core state with storage device.
-
- -d Avoid syncing metadata.
-*/
-#define FOR_fsync
-#include "toys.h"
-
-static void do_fsync(int fd, char *name)
-{
- if (((toys.optflags & FLAG_d) ? fdatasync(fd) : fsync(fd)))
- perror_msg("can't sync '%s'", name);
-}
-
-void fsync_main(void)
-{
- loopfiles_rw(toys.optargs, O_RDONLY|O_NOATIME|O_NOCTTY|O_CLOEXEC,
- 0, 0, do_fsync);
-}