public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] test-container: Fix "unused code" warnings on HURD
Date: Mon, 11 Apr 2022 23:28:49 +0000 (GMT)	[thread overview]
Message-ID: <20220411232849.23B1C3858D1E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d2263bf50af9aab84210c8c9bbf100bd780efad9

commit d2263bf50af9aab84210c8c9bbf100bd780efad9
Author: DJ Delorie <dj@redhat.com>
Date:   Mon Apr 11 15:45:35 2022 -0400

    test-container: Fix "unused code" warnings on HURD
    
    Comment out bits of code that are only used when we *have* pid
    namespaces, to avoid "unused code" warnings.
    
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    
    Message-Id: <xno817tnds.fsf@greed.delorie.com>

Diff:
---
 support/test-container.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/support/test-container.c b/support/test-container.c
index c837c4d758..7557aac441 100644
--- a/support/test-container.c
+++ b/support/test-container.c
@@ -230,6 +230,7 @@ concat (const char *str, ...)
   return bufs[n];
 }
 
+#ifdef CLONE_NEWNS
 /* Like the above, but put spaces between words.  Caller frees.  */
 static char *
 concat_words (char **words, int num_words)
@@ -255,6 +256,7 @@ concat_words (char **words, int num_words)
 
   return rv;
 }
+#endif
 
 /* Try to mount SRC onto DEST.  */
 static void
@@ -756,7 +758,9 @@ main (int argc, char **argv)
   /* If set, the test runs as root instead of the user running the testsuite.  */
   int be_su = 0;
   int require_pidns = 0;
+#ifdef CLONE_NEWNS
   const char *pidns_comment = NULL;
+#endif
   int do_proc_mounts = 0;
   int UMAP;
   int GMAP;
@@ -1046,8 +1050,10 @@ main (int argc, char **argv)
 	    else if (nt >= 1 && strcmp (the_words[0], "pidns") == 0)
 	      {
 		require_pidns = 1;
+#ifdef CLONE_NEWNS
 		if (nt > 1)
 		  pidns_comment = concat_words (the_words + 1, nt - 1);
+#endif
 	      }
 	    else if (nt == 3 && strcmp (the_words[0], "mkdirp") == 0)
 	      {


                 reply	other threads:[~2022-04-11 23:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220411232849.23B1C3858D1E@sourceware.org \
    --to=sthibaul@sourceware.org \
    --cc=glibc-cvs@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).