From patchwork Mon Apr 11 19:45:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 1615911 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=ASWx55FZ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KcfVC0Kfrz9sDX for ; Tue, 12 Apr 2022 05:45:55 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A07E13857354 for ; Mon, 11 Apr 2022 19:45:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A07E13857354 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649706351; bh=AVxbPZ6w/p3QJH0RzAQHMkDjjPjGJg95xN3aD3V0svk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ASWx55FZsf6kdAbVSfdkz7CJ+CPMXNL+6NyBTkOKPn0cU6LTVIIVPDe3vJ9kCtUti tkXaJtzSgXkL2a/fSy1GvyEq6UFDn2t0ZZRrM1e1XqGbayvmrWKEAH6dmnf7aO5uzd dc2duPMJ3JjpQCZmlc078k56LZ5WRJ0aF1bDL6xk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id B75EE3858D1E for ; Mon, 11 Apr 2022 19:45:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B75EE3858D1E Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-551-auHdSH96O1e0UE69KDFPOQ-1; Mon, 11 Apr 2022 15:45:36 -0400 X-MC-Unique: auHdSH96O1e0UE69KDFPOQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EFDDF2A5956A for ; Mon, 11 Apr 2022 19:45:35 +0000 (UTC) Received: from greed.delorie.com (ovpn-112-4.rdu2.redhat.com [10.10.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA8C31415133 for ; Mon, 11 Apr 2022 19:45:35 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.15.2/8.15.2) with ESMTP id 23BJjZOQ222266 for ; Mon, 11 Apr 2022 15:45:35 -0400 To: libc-alpha@sourceware.org Subject: test-container: Fix "unused code" warnings on HURD Date: Mon, 11 Apr 2022 15:45:35 -0400 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: DJ Delorie via Libc-alpha From: DJ Delorie Reply-To: DJ Delorie Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" [mix of my previous patch plus fixing Florian's reported bug] [I tried to install HURD locally in a VM and couldn't, so... untested on HURD] Comment out bits of code that are only used when we *have* pid namespaces, to avoid "unused code" warnings. 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) {