From 9a51ee3f9fbd12e2ded858c8b9c72b2d5e56b83d Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 19 Sep 1999 21:13:30 +0000 Subject: 1999-09-19 Roland McGrath * 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. --- libdiskfs/opts-std-runtime.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'libdiskfs/opts-std-runtime.c') diff --git a/libdiskfs/opts-std-runtime.c b/libdiskfs/opts-std-runtime.c index a59e95e0..1937bdbd 100644 --- a/libdiskfs/opts-std-runtime.c +++ b/libdiskfs/opts-std-runtime.c @@ -1,6 +1,6 @@ /* Parse standard run-time options - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU Hurd. @@ -22,22 +22,17 @@ #include "priv.h" -#define OPT_SUID_OK 600 -#define OPT_EXEC_OK 601 - static const struct argp_option std_runtime_options[] = { {"update", 'u', 0, 0, "Flush any meta-data cached in core"}, {"remount", 0, 0, OPTION_HIDDEN | OPTION_ALIAS}, /* deprecated */ - {"suid-ok", OPT_SUID_OK, 0, 0, "Enable set-uid execution"}, - {"exec-ok", OPT_EXEC_OK, 0, 0, "Enable execution of files"}, {0, 0} }; struct parse_hook { - int readonly, sync, sync_interval, remount, nosuid, noexec; + int readonly, sync, sync_interval, remount, nosuid, noexec, noatime; }; /* Implement the options in H, and free H. */ @@ -82,6 +77,8 @@ set_opts (struct parse_hook *h) _diskfs_nosuid = h->nosuid; if (h->noexec != -1) _diskfs_noexec = h->noexec; + if (h->noatime != -1) + _diskfs_noatime = h->noatime; free (h); @@ -100,8 +97,10 @@ parse_opt (int opt, char *arg, struct argp_state *state) case 'u': h->remount = 1; break; case 'S': h->nosuid = 1; break; case 'E': h->noexec = 1; break; + case 'A': h->noatime = 1; break; case OPT_SUID_OK: h->nosuid = 0; break; case OPT_EXEC_OK: h->noexec = 0; break; + case OPT_ATIME: h->noatime = 0; break; case 'n': h->sync_interval = 0; h->sync = 0; break; case 's': if (arg) @@ -113,7 +112,6 @@ parse_opt (int opt, char *arg, struct argp_state *state) h->sync = 1; break; - case ARGP_KEY_INIT: if (state->input) state->hook = state->input; /* Share hook with parent. */ -- cgit v1.2.3