[PATCH v2 1/2] app/test: fix ifdefs in header for managing subprocesses
Marat Khalili
marat.khalili at huawei.com
Thu Feb 26 18:04:59 CET 2026
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson at intel.com>
> Sent: Wednesday 25 February 2026 16:21
> To: dev at dpdk.org
> Cc: Bruce Richardson <bruce.richardson at intel.com>; stable at dpdk.org
> Subject: [PATCH v2 1/2] app/test: fix ifdefs in header for managing subprocesses
>
> The #endif for the #ifdef Linux block to add the "get_current_prefix()"
> and the "file_prefix_arg()" functions to process.h was on the wrong
> line, leaving a stray "}" outside the block. Fix this and in the process
> (no pun intended) simplify the #ifdefs to just a non-Linux and a Linux
> block, removing one level of #ifdefs.
>
> Fixes: f17b6eacf00a ("test: avoid file prefix overflow")
> Cc: stable at dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
> app/test/process.h | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/app/test/process.h b/app/test/process.h
> index 402dc4f96f..a21cdfd46d 100644
> --- a/app/test/process.h
> +++ b/app/test/process.h
> @@ -225,17 +225,14 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
> return status;
> }
>
> -/* FreeBSD doesn't support file prefixes, so no argument passed. */
> -#ifdef RTE_EXEC_ENV_FREEBSD
> +/* Only Linux supports file prefixes. */
> +#ifndef RTE_EXEC_ENV_LINUX
> static inline const char *
> file_prefix_arg(void)
> {
> - /* BSD target doesn't support prefixes at this point */
> return "";
> }
> -#else
> -
> -#ifdef RTE_EXEC_ENV_LINUX
> +#else /* RTE_EXEC_ENV_LINUX */
> static inline char *
> get_current_prefix(char *prefix, int size)
> {
> @@ -253,7 +250,7 @@ get_current_prefix(char *prefix, int size)
> return prefix;
> }
>
> -/* Return a --file-prefix=XXXX argument or NULL */
> +/* Return a --file-prefix=XXXX argument */
> static inline const char *
> file_prefix_arg(void)
> {
> @@ -267,8 +264,7 @@ file_prefix_arg(void)
>
> snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
> return prefix;
> -#endif
> }
> -#endif
> +#endif /* RTE_EXEC_ENV_LINUX */
>
> #endif /* _PROCESS_H_ */
> --
> 2.51.0
Acked-by: Marat Khalili <marat.khalili at huawei.com>
Tested on Linux.
More information about the stable
mailing list