summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-01-19 22:34:35 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-01-19 22:34:35 +0100
commit63abc67ed48dbdf8dfe01fd1f29a97d795f907ce (patch)
treeceab5da71524adf84606fe36ff7520056461b69c
parentc2185ab7ca837967ba58dffeca7904caaca0d46e (diff)
procfs: Move setting default parameters to a separate function
* procfs/main.c (set_default_options): New function (argp_parser): Call `set_default_options'.
-rw-r--r--procfs/main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/procfs/main.c b/procfs/main.c
index 509f4883..5f84d625 100644
--- a/procfs/main.c
+++ b/procfs/main.c
@@ -50,6 +50,13 @@ uid_t opt_anon_owner;
#define NOEXEC_KEY -2 /* Likewise. */
#define NOSUID_KEY -3 /* Likewise. */
+static void set_default_options (void)
+{
+ opt_clk_tck = 100;
+ opt_stat_mode = 0444;
+ opt_fake_self = 1;
+}
+
static error_t
argp_parser (int key, char *arg, struct argp_state *state)
{
@@ -97,9 +104,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
break;
case 'c':
- opt_clk_tck = 100;
- opt_stat_mode = 0444;
- opt_fake_self = 1;
+ set_default_options();
break;
case 'a':