1 /* vi: set sw=4 ts=4: */
3 * Mini fsync implementation for busybox
5 * Copyright (C) 2008 Nokia Corporation. All rights reserved.
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
11 /* This is a NOFORK applet. Be very careful! */
13 int fsync_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
14 int fsync_main(int argc UNUSED_PARAM, char **argv)
19 opts = getopt32(argv, "d"); /* fdatasync */
25 status = EXIT_SUCCESS;
27 int fd = open3_or_warn(*argv, O_NOATIME | O_NOCTTY | O_RDONLY, 0);
30 status = EXIT_FAILURE;
33 if ((opts ? fdatasync(fd) : fsync(fd))) {
34 //status = EXIT_FAILURE; - do we want this?
35 bb_simple_perror_msg(*argv);