summaryrefslogtreecommitdiff
path: root/libdiskfs/opts-get.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-06-20 03:21:34 +0000
committerMiles Bader <miles@gnu.org>1996-06-20 03:21:34 +0000
commit0cdc45ed84415fd388887f1e613ddf11648aa406 (patch)
tree4b1f4f957909acb4177e5ce0dd1e725a5601c20b /libdiskfs/opts-get.c
parenta81ff69eda8d1e69139ebf6898de5572c9e39400 (diff)
(diskfs_get_options): Call diskfs_append_std_options to do most of the work.
Diffstat (limited to 'libdiskfs/opts-get.c')
-rw-r--r--libdiskfs/opts-get.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/libdiskfs/opts-get.c b/libdiskfs/opts-get.c
index 3d84b372..26558212 100644
--- a/libdiskfs/opts-get.c
+++ b/libdiskfs/opts-get.c
@@ -1,6 +1,6 @@
/* Get run-time options
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -25,34 +25,7 @@
error_t
diskfs_get_options (char **argz, unsigned *argz_len)
{
- extern int diskfs_sync_interval;
-
- void append_opt (char *str)
- {
- unsigned old_end = *argz_len;
- *argz_len += strlen (str) + 1;
- *argz = realloc (*argz, *argz_len);
- strcpy (*argz + old_end, str);;
- }
-
*argz = 0;
*argz_len = 0;
-
- if (diskfs_readonly)
- append_opt ("--readonly");
- else
- append_opt ("--writable");
-
- if (diskfs_synchronous)
- append_opt ("--sync");
- else if (diskfs_sync_interval == 0)
- append_opt ("--nosync");
- else
- {
- char buf[80];
- sprintf (buf, "--sync=%d", diskfs_sync_interval);
- append_opt (buf);
- }
-
- return 0;
+ return diskfs_append_std_options (argz, argz_len);
}