From b542b6651ac0cb2332693596382080925d924a53 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 3 Apr 2012 11:26:11 +0100 Subject: ash: some fixes so busybox-w32 (almost) compiles on POSIX --- include/mingw.h | 1 - shell/ash.c | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/mingw.h b/include/mingw.h index c99612b9c..f89297df9 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -348,7 +348,6 @@ int utimes(const char *file_name, const struct timeval times[2]); /* * MinGW specific */ -#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':') #define is_dir_sep(c) ((c) == '/' || (c) == '\\') #define PRIuMAX "I64u" diff --git a/shell/ash.c b/shell/ash.c index f8fc668c8..68d39c1f3 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -85,6 +85,10 @@ # define PIPE_BUF 4096 /* amount of buffering in a pipe */ #endif +#if !ENABLE_PLATFORM_MINGW32 +# define is_absolute_path(path) ((path)[0] == '/') +#endif + #if !BB_MMU # error "Do not even bother, ash will not run on NOMMU machine" #endif @@ -9036,7 +9040,7 @@ forkshell_evalsubshell(struct forkshell *fs) static void evalsubshell(union node *n, int flags) { - IF_PLATFORM_MINGW32(struct forkshell fs); + IF_PLATFORM_MINGW32(struct forkshell fs;) struct job *jp; int backgnd = (n->type == NBACKGND); int status; @@ -9158,7 +9162,7 @@ forkshell_evalpipe(struct forkshell *fs) static void evalpipe(union node *n, int flags) { - IF_PLATFORM_MINGW32(struct forkshell fs); + IF_PLATFORM_MINGW32(struct forkshell fs;) struct job *jp; struct nodelist *lp; int pipelen; @@ -12821,7 +12825,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) struct stat statb; int e; int updatetbl; - IF_PLATFORM_MINGW32(int len); + IF_PLATFORM_MINGW32(int len;) struct builtincmd *bcmd; /* If name contains a slash, don't use PATH or hash table */ @@ -13860,6 +13864,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv) /* NOTREACHED */ } +#if ENABLE_PLATFORM_MINGW32 /* FIXME: should consider running forkparent() and forkchild() */ static int spawn_forkshell(struct job *jp, struct forkshell *fs, int mode) @@ -14378,6 +14383,7 @@ sticky_free(void *base) return; free(base); } +#endif /*- * Copyright (c) 1989, 1991, 1993, 1994 -- cgit v1.2.3-55-g6feb