1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-15 08:15:49 +02:00
Files
coreutils/src/sync.c

74 lines
1.9 KiB
C
Raw Normal View History

1994-07-01 17:59:34 +00:00
/* sync - update the super block
1999-02-16 04:14:17 +00:00
Copyright (C) 1994-1999 Free Software Foundation, Inc.
1994-07-01 17:59:34 +00:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
1996-03-24 18:47:09 +00:00
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
1994-07-01 17:59:34 +00:00
/* Written by Jim Meyering */
1994-07-01 17:59:34 +00:00
#include <config.h>
#include <stdio.h>
1994-10-08 00:34:54 +00:00
#include <sys/types.h>
1994-07-01 17:59:34 +00:00
#include "system.h"
#include "error.h"
1999-03-26 14:12:32 +00:00
#include "long-options.h"
1994-07-01 17:59:34 +00:00
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "sync"
#define AUTHORS "Jim Meyering"
1994-07-01 17:59:34 +00:00
/* The name this program was run with. */
char *program_name;
void
1995-11-09 17:02:23 +00:00
usage (int status)
1994-07-01 17:59:34 +00:00
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
1994-07-01 17:59:34 +00:00
program_name);
else
{
printf (_("Usage: %s [OPTION]\n"), program_name);
printf (_("\
Force changed blocks to disk, update the super block.\n\
1994-07-01 17:59:34 +00:00
\n\
--help display this help and exit\n\
--version output version information and exit\n\
"));
1998-09-19 17:17:58 +00:00
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
close_stdout ();
1994-07-01 17:59:34 +00:00
}
exit (status);
}
int
1995-11-09 17:02:23 +00:00
main (int argc, char **argv)
1994-07-01 17:59:34 +00:00
{
program_name = argv[0];
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
1994-07-01 17:59:34 +00:00
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
AUTHORS, usage);
1994-07-01 17:59:34 +00:00
if (argc != 1)
error (0, 0, _("ignoring all arguments"));
1994-07-01 17:59:34 +00:00
sync ();
exit (0);
}