diff options
author | Joel Stanley <joel@jms.id.au> | 2018-03-06 14:32:18 +1030 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-03-07 16:24:31 +1100 |
commit | 2b86765dfa37f9b447fe983967c1dcbc712a4989 (patch) | |
tree | 89e2e7b5d5842a1cab6042d696c92c000a9536f8 /discover/paths.c | |
parent | 352f5c2729dc8b40524e45ddde4f560ded717ec8 (diff) | |
download | talos-petitboot-2b86765dfa37f9b447fe983967c1dcbc712a4989.tar.gz talos-petitboot-2b86765dfa37f9b447fe983967c1dcbc712a4989.zip |
discover: Fix unused function warning
clang errors out about an unused have_busybox function:
discover/paths.c:44:13: error: unused function 'have_busybox' [-Werror,-Wunused-function]
static bool have_busybox(void)
^
Move have_busybox() to inside the #ifndef PETITBOOT_TEST scope to
eliminate the warning and avoid having #ifdefs in load_url_async().
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
[Moved definition into #ifndef PETITBOOT_TEST instead of using
#ifdef at the call site]
Diffstat (limited to 'discover/paths.c')
-rw-r--r-- | discover/paths.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/discover/paths.c b/discover/paths.c index 24e978b..c5b5778 100644 --- a/discover/paths.c +++ b/discover/paths.c @@ -41,15 +41,6 @@ struct load_task { void *async_data; }; -static inline bool have_busybox(void) -{ -#ifdef WITH_BUSYBOX - return true; -#else - return false; -#endif -} - const char *mount_base(void) { return DEVICE_MOUNT_BASE; @@ -71,6 +62,12 @@ char *join_paths(void *alloc_ctx, const char *a, const char *b) #ifndef PETITBOOT_TEST +#ifdef WITH_BUSYBOX +static inline bool have_busybox(void) { return true; } +#else +static inline bool have_busybox(void) { return false; } +#endif + static char *local_name(void *ctx) { char *ret, tmp[] = "/tmp/pb-XXXXXX"; |