summaryrefslogtreecommitdiff
path: root/libdiskfs/opts-std-startup.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-09-19 21:13:30 +0000
committerRoland McGrath <roland@gnu.org>1999-09-19 21:13:30 +0000
commit9a51ee3f9fbd12e2ded858c8b9c72b2d5e56b83d (patch)
treeb12e1daa527863b7a75e1bb20c95f2e4dc7571b6 /libdiskfs/opts-std-startup.c
parent8f79eed4594225520bc8877e0f36a5ff015fc796 (diff)
1999-09-19 Roland McGrath <roland@baalperazim.frob.com>
* node-times.c (diskfs_set_node_times): If _diskfs_noatime is set and neither NP->dn_set_mtime nor NP->dn_set_ctime is set, clear NP->dn_set_atime. Short-circuit return if none of dn_set_?time set. * opts-common.c (diskfs_common_options): Include "priv.h". Add aliases --ro/--rw for -r/-w. Add alias --nosuid for --no-suid, --noexec for --no-exec. Move --suid-ok, --exec-ok here from ... * opts-std-runtime.c (std_runtime_options): ... here. (struct parse_hook): New member `noatime'. (set_opts): Use H->noatime to set _diskfs_noatime. (parse_opt): Grok -A and OPT_ATIME to set/clear H->noatime. (OPT_ATIME): New macro. (OPT_SUID_OK, OPT_EXEC_OK): Moved to ... * priv.h: ... here. (diskfs_common_options): Add const to decl. * opts-std-startup.c (parse_startup_opt): Grok OPT_SUID_OK, OPT_EXEC_OK, -A, and OPT_ATIME. * init-init.c (_diskfs_noatime): New variable. (_diskfs_nosuid, _diskfs_noexec): Use uninitialized defns. * opts-append-std.c (diskfs_append_std_options): Add --no-atime if _diskfs_noatime is set.
Diffstat (limited to 'libdiskfs/opts-std-startup.c')
-rw-r--r--libdiskfs/opts-std-startup.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libdiskfs/opts-std-startup.c b/libdiskfs/opts-std-startup.c
index e03c2722..24d403a7 100644
--- a/libdiskfs/opts-std-startup.c
+++ b/libdiskfs/opts-std-startup.c
@@ -1,6 +1,6 @@
/* Standard startup-time command line parser
- Copyright (C) 1995, 96, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1995, 96, 97, 98, 99 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -67,14 +67,15 @@ parse_startup_opt (int opt, char *arg, struct argp_state *state)
{
switch (opt)
{
- case 'r':
- diskfs_readonly = 1; break;
- case 'w':
- diskfs_readonly = 0; break;
- case 'S':
- _diskfs_nosuid = 1; break;
- case 'E':
- _diskfs_noexec = 1; break;
+#define TOGGLE(var, on, off) \
+ case on: var = 1; break; \
+ case off: var = 1; break;
+ TOGGLE (diskfs_readonly, 'r', 'w');
+ TOGGLE (_diskfs_nosuid, 'S', OPT_SUID_OK);
+ TOGGLE (_diskfs_noexec, 'E', OPT_EXEC_OK);
+ TOGGLE (_diskfs_noatime, 'A', OPT_ATIME);
+#undef TOGGLE
+
case 's':
if (arg == NULL)
diskfs_synchronous = 1;
@@ -86,7 +87,6 @@ parse_startup_opt (int opt, char *arg, struct argp_state *state)
diskfs_default_sync_interval = 0;
break;
-
/* Boot options */
case OPT_DEVICE_MASTER_PORT:
_hurd_device_master = atoi (arg); break;