diff options
author | Gilad Arnold <garnold@google.com> | 2015-09-01 11:06:40 -0700 |
---|---|---|
committer | Gilad Arnold <garnold@google.com> | 2015-09-01 11:08:56 -0700 |
commit | 4a0ae0177f07c62d336268082539dd64149aa288 (patch) | |
tree | 412efbc04977d7a682ecbbba0c8d64f23cf5578e | |
parent | 727698b640dad91c1016d26e6cac74e5bc893598 (diff) | |
download | tlsdate-4a0ae0177f07c62d336268082539dd64149aa288.tar.gz |
Relocate a function to fix a build failure.
This ensures that parse_supp_groups() is only built with main().
Bug: 22373707
Change-Id: I81ab8b7718592d43a8ccccb1ee1e694367205463
-rw-r--r-- | src/tlsdated.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/tlsdated.c b/src/tlsdated.c index 4517be0..63dfbd4 100644 --- a/src/tlsdated.c +++ b/src/tlsdated.c @@ -227,21 +227,6 @@ parse_argv (struct opts *opts, int argc, char *argv[]) /* Validate arguments */ } -static const char ** -parse_supp_groups (char *arg) -{ - size_t i; - char *scan; - const char **supp_groups; - - for (i = 1, scan = arg; (scan = strchr (scan, ',')); i++, scan++) ; - supp_groups = (const char **) calloc (i + 1, sizeof (const char *)); - if (!supp_groups) - die ("Failed to allocate memory for supplementary group names\n"); - for (i = 0; (supp_groups[i] = strsep (&arg, ",")); i++) ; - return supp_groups; -} - static void add_source_to_conf (struct opts *opts, char *host, char *port, char *proxy) { @@ -465,6 +450,21 @@ cleanup_main (struct state *state) } #ifdef TLSDATED_MAIN +static const char ** +parse_supp_groups (char *arg) +{ + size_t i; + char *scan; + const char **supp_groups; + + for (i = 1, scan = arg; (scan = strchr (scan, ',')); i++, scan++) ; + supp_groups = (const char **) calloc (i + 1, sizeof (const char *)); + if (!supp_groups) + die ("Failed to allocate memory for supplementary group names\n"); + for (i = 0; (supp_groups[i] = strsep (&arg, ",")); i++) ; + return supp_groups; +} + int API main (int argc, char *argv[], char *envp[]) { |