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: [email protected]

Signed-off-by: Bruce Richardson <[email protected]>
---
 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

Reply via email to