From 015abc3b736ce8cb784b9e60d8c4cf2427874d2d Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 23 Jun 2008 13:53:57 +0200 Subject: [PATCH] Use only one copy of struct select_conf. Previously, we had one copy in select.c and another copy in interactive.c. Define a single copy in adu.c instead and use it from both interactive.c and select.c. --- adu.c | 4 ++++ adu.h | 1 + interactive.c | 2 -- select.c | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/adu.c b/adu.c index 09619cf..02bfa30 100644 --- a/adu.c +++ b/adu.c @@ -8,6 +8,7 @@ #include "string.h" #include "error.h" #include "portable_io.h" +#include "select.cmdline.h" DEFINE_ERRLIST; int osl_errno; @@ -18,6 +19,9 @@ static int signum; /** Command line and config file options. */ struct gengetopt_args_info conf; +/** Options passed to --select-options. */ +struct select_args_info select_conf; + /** The number of different uids found so far. */ uint32_t num_uids = 0; diff --git a/adu.h b/adu.h index 70dba77..6096692 100644 --- a/adu.h +++ b/adu.h @@ -178,6 +178,7 @@ enum search_uid_flags { extern uint32_t num_uids; extern struct osl_table *dir_table; extern struct gengetopt_args_info conf; +extern struct select_args_info select_conf; /* adu.c */ __printf_2_3 void __log(int, const char*, ...); diff --git a/interactive.c b/interactive.c index 8b27c0c..376ab48 100644 --- a/interactive.c +++ b/interactive.c @@ -4,8 +4,6 @@ #include "cmdline.h" #include "select.cmdline.h" -struct select_args_info select_conf; - struct interactive_command { const char *name; int (*handler)(char *); diff --git a/select.c b/select.c index 0c73a58..9353c5f 100644 --- a/select.c +++ b/select.c @@ -77,7 +77,6 @@ static const uint64_t count_unit_divisors[] = { static const char size_unit_abbrevs[] = " BKMGT"; static const char count_unit_abbrevs[] = " kmgt"; -struct select_args_info select_conf; static struct uid_range *admissible_uids; static enum enum_size_unit format_size_value(enum enum_size_unit unit, -- 2.39.5