All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Maciej Żenczykowski" <zenczykowski@gmail.com>
To: "Maciej Żenczykowski" <maze@google.com>,
	"Pablo Neira Ayuso" <pablo@netfilter.org>,
	"Florian Westphal" <fw@strlen.de>
Cc: Linux Network Development Mailing List <netdev@vger.kernel.org>,
	Netfilter Development Mailing List 
	<netfilter-devel@vger.kernel.org>
Subject: [PATCH iptables] libxtables/xtables.c - compiler warning fixes for NO_SHARED_LIBS
Date: Tue, 23 Jun 2020 16:09:02 -0700	[thread overview]
Message-ID: <20200623230902.236511-1-zenczykowski@gmail.com> (raw)

From: Maciej Żenczykowski <maze@google.com>

Fixes two issues with NO_SHARED_LIBS:
 - #include <dlfcn.h> is ifdef'ed out and thus dlclose()
   triggers an undeclared function compiler warning
 - dlreg_add() is unused and thus triggers an unused
   function warning

Test: builds without warnings
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
 libxtables/xtables.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libxtables/xtables.c b/libxtables/xtables.c
index 7fe42580..8907ba20 100644
--- a/libxtables/xtables.c
+++ b/libxtables/xtables.c
@@ -206,6 +206,7 @@ struct xtables_target *xtables_targets;
 static bool xtables_fully_register_pending_match(struct xtables_match *me);
 static bool xtables_fully_register_pending_target(struct xtables_target *me);
 
+#ifndef NO_SHARED_LIBS
 /* registry for loaded shared objects to close later */
 struct dlreg {
 	struct dlreg *next;
@@ -237,6 +238,7 @@ static void dlreg_free(void)
 		dlreg = next;
 	}
 }
+#endif
 
 void xtables_init(void)
 {
@@ -267,7 +269,9 @@ void xtables_init(void)
 
 void xtables_fini(void)
 {
+#ifndef NO_SHARED_LIBS
 	dlreg_free();
+#endif
 }
 
 void xtables_set_nfproto(uint8_t nfproto)
-- 
2.27.0.111.gc72c7da667-goog


             reply	other threads:[~2020-06-23 23:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 23:09 Maciej Żenczykowski [this message]
2020-06-23 23:11 ` [PATCH iptables] libxtables/xtables.c - compiler warning fixes for NO_SHARED_LIBS Maciej Żenczykowski
2020-07-04  0:08 ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200623230902.236511-1-zenczykowski@gmail.com \
    --to=zenczykowski@gmail.com \
    --cc=fw@strlen.de \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.