From dcca23dc4cf9b51a1c2576360fea190e9b71204e Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 13 Jul 2021 10:39:58 +0100 Subject: ash, libbb: don't affect POSIX build Tweak code to avoid contamination of the POSIX build. There weren't any adverse effects, but better safe than sorry. --- shell/ash.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index 712286fbd..8b8c5f1dc 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -349,8 +349,9 @@ typedef long arith_t; # define BB_GLOBAL_CONST const #endif -#define FORKSHELL_DEBUG 0 #if ENABLE_PLATFORM_MINGW32 +# define FORKSHELL_DEBUG 0 + union node; struct strlist; struct job; @@ -9660,17 +9661,20 @@ nodeckstrdup(const char *s) static union node *copynode(union node *); -#if ENABLE_PLATFORM_MINGW32 && FORKSHELL_DEBUG -# define FREE 1 -# define NO_FREE 2 -# define ANNOT(dst,note) {if (annot) annot[(char *)&dst - (char *)fs_start] = note;} -#else -# define FREE 1 -# define NO_FREE 1 -# define ANNOT(dst,note) -#endif - #if ENABLE_PLATFORM_MINGW32 +# if FORKSHELL_DEBUG +# define FREE 1 +# define NO_FREE 2 +# define ANNOT(dst,note) { \ + if (annot) \ + annot[(char *)&dst - (char *)fs_start] = note; \ + } +# else +# define FREE 1 +# define NO_FREE 1 +# define ANNOT(dst,note) +# endif + /* The relocation map is offset from the start of the forkshell data * block by 'fs_size' bytes. The flag relating to a particular destination * pointer is thus at (dst+fs_size). */ -- cgit v1.2.3-55-g6feb