X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=e2fsck%2Fflushb.c;h=6100fc61430ca44fed12bc844a00cb027b3bae8a;hb=dc981d15c5de832f5675c13d53baeeaaa9bc232a;hp=34ebe6da8fd3ac9c8c13be904fcfb1eb4f08a80a;hpb=80e808fceb61c2061b32593c610893bf07a863ee;p=tools%2Fe2fsprogs.git diff --git a/e2fsck/flushb.c b/e2fsck/flushb.c index 34ebe6d..6100fc6 100644 --- a/e2fsck/flushb.c +++ b/e2fsck/flushb.c @@ -1,33 +1,45 @@ /* * flushb.c --- This routine flushes the disk buffers for a disk + * + * Copyright 1997, 2000, by Theodore Ts'o. + * + * WARNING: use of flushb on some older 2.2 kernels on a heavily loaded + * system will corrupt filesystems. This program is not really useful + * beyond for benchmarking scripts. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU Public + * License. + * %End-Header% */ +#include "config.h" #include #include #include #include #include #include +#include +#include "../misc/nls-enable.h" -#ifdef __STDC__ -#define NOARGS void -#else -#define NOARGS -#define const +/* For Linux, define BLKFLSBUF if necessary */ +#if (!defined(BLKFLSBUF) && defined(__linux__)) +#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */ #endif const char *progname; -static void usage(NOARGS) +static void usage(void) { - fprintf(stderr, "Usage: %s disk\n", progname); + fprintf(stderr, _("Usage: %s disk\n"), progname); exit(1); -} - +} + int main(int argc, char **argv) { int fd; - + progname = argv[0]; if (argc != 2) usage(); @@ -49,7 +61,7 @@ int main(int argc, char **argv) return 0; #else fprintf(stderr, - "BLKFLSBUF ioctl not supported! Can't flush buffers.\n"); + _("BLKFLSBUF ioctl not supported! Can't flush buffers.\n")); return 1; #endif }