From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=EWX6Kl+v; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 3221E5A061F for ; Wed, 06 Nov 2024 00:27:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1730849254; bh=5eASP0NkvqPeiNdkYBuPfH1y403NPFebxqVtFqOFZek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EWX6Kl+v59+zwfmqASGX4eiIzYeG/30JZN1ZioKG/aY+08q5alkCyWG8r9UwSf+Ns ahtafOsQMlzLAINejzNL3yCe7izHuwQ94Q1l7RrE7d5vre6qHyBYMH2SoUX37J2Qq3 A4ZHxP0Xn8PbU9k9vv18fFNQiWimR/68I93vDvDf7vRKf5D+KS1DwlsB8o+n1QS0Ry GGf0G2DFDdhQ0ryQpRD46Z6tgKfCdUulPn4MTFY6PONf8+1pXHcNUthyXu1Hkkjo0C O7YrOO1qBOhWhCTEHxW6xvZhnaKo1XcKYqn4ObBooTX97L1cySY9GyHtNPAIGajCXO syy1SnYUSZ8+A== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XjkyZ4Jprz4xG8; Wed, 6 Nov 2024 10:27:34 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 07/12] Makefile: Move NETNS_RUN_DIR definition to C code Date: Wed, 6 Nov 2024 10:25:23 +1100 Message-ID: <20241105232528.1408144-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105232528.1408144-1-david@gibson.dropbear.id.au> References: <20241105232528.1408144-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: XQDFMZIZCXM3AZHGQYQJ4GGY77GAK6QK X-Message-ID-Hash: XQDFMZIZCXM3AZHGQYQJ4GGY77GAK6QK X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: NETNS_RUN_DIR is set in the Makefile, then passed into the C code with -D. But NETNS_RUN_DIR is just a fixed string, it doesn't depend on any make probes or variables, so there's really no reason to handle it via the Makefile. Just move it to a plain #define in conf.c. Signed-off-by: David Gibson --- Makefile | 1 - conf.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f1e9937..41f24e8 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,6 @@ FLAGS := -Wall -Wextra -Wno-format-zero-length FLAGS += -pedantic -std=c11 -D_XOPEN_SOURCE=700 -D_GNU_SOURCE FLAGS += $(FORTIFY_FLAG) -O2 -pie -fPIE FLAGS += -DPAGE_SIZE=$(shell getconf PAGE_SIZE) -FLAGS += -DNETNS_RUN_DIR=\"/run/netns\" FLAGS += -DPASST_AUDIT_ARCH=AUDIT_ARCH_$(AUDIT_ARCH) FLAGS += -DRLIMIT_STACK_VAL=$(RLIMIT_STACK_VAL) FLAGS += -DARCH=\"$(TARGET_ARCH)\" diff --git a/conf.c b/conf.c index 14411b4..86566db 100644 --- a/conf.c +++ b/conf.c @@ -46,6 +46,8 @@ #include "isolation.h" #include "log.h" +#define NETNS_RUN_DIR "/run/netns" + /** * next_chunk - Return the next piece of a string delimited by a character * @s: String to search -- 2.47.0