diff options
author | Miles Bader <miles@gnu.org> | 1995-05-12 22:37:58 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-05-12 22:37:58 +0000 |
commit | fb6d48a6b26458fd2dac058999dd25a71b0e7e2a (patch) | |
tree | 2e7e724f62172fa7f55a7b65582c059d6b00538f /ext2fs/ext2fs.c | |
parent | 853b8fddb9e8bcc610052b2a7dbb8ce42f59a825 (diff) |
Add an optional argument to the --sync option that lets the user specify an
initial sync interval.
Diffstat (limited to 'ext2fs/ext2fs.c')
-rw-r--r-- | ext2fs/ext2fs.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c index 2e1dd9e0..16e7ee5e 100644 --- a/ext2fs/ext2fs.c +++ b/ext2fs/ext2fs.c @@ -143,7 +143,8 @@ usage(int status) printf("\ \n\ -r, --readonly disable writing to DEVICE\n\ - -s, --synchronous write data out immediately\n\ + -s, --sync[=INTERVAL] write data out immediately or at least ever\n\ + INTERVAL seconds\n\ --help display this help and exit\n\ --version output version information and exit\n\ "); @@ -156,7 +157,7 @@ usage(int status) static struct option options[] = { {"readonly", no_argument, 0, 'r'}, - {"synchronous", no_argument, 0, 's'}, + {"sync", optional_argument, 0, 's'}, {"help", no_argument, 0, '?'}, {"version", no_argument, 0, 'V'}, {0, 0, 0, 0} @@ -165,8 +166,6 @@ static struct option options[] = /* ---------------------------------------------------------------- */ -int check_string = 1; - void main (int argc, char **argv) { @@ -196,7 +195,11 @@ main (int argc, char **argv) case 'r': diskfs_readonly = 1; break; case 's': - diskfs_synchronous = 1; break; + if (optarg == NULL) + diskfs_synchronous = 1; + else + diskfs_default_sync_interval = atoi (optarg); + break; case 'V': printf("%s %d.%d.%d\n", diskfs_server_name, diskfs_major_version, diskfs_minor_version, diskfs_edit_version); @@ -309,7 +312,7 @@ main (int argc, char **argv) if (bootstrap == MACH_PORT_NULL) /* We are the bootstrap filesystem; do special boot-time setup. */ diskfs_start_bootstrap (argv); - + /* Now become a generic request thread. */ diskfs_main_request_loop (); } |