diff options
author | Ron Yorston <rmy@pobox.com> | 2019-02-17 16:08:01 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-02-17 16:11:32 +0000 |
commit | b1dcae0da4f5e9713fd54678ec42709a1744474b (patch) | |
tree | 57581923b3262e661ee2cd4ae627d66f06ca1aee | |
parent | 743580b4c029e200b1390075a1328ab314973bc2 (diff) | |
download | busybox-w32-b1dcae0da4f5e9713fd54678ec42709a1744474b.tar.gz busybox-w32-b1dcae0da4f5e9713fd54678ec42709a1744474b.tar.bz2 busybox-w32-b1dcae0da4f5e9713fd54678ec42709a1744474b.zip |
win32: fix POSIX build
There were a few places where changes intended for the WIN32 build
also affected the POSIX build. Fix these so the result of 'make
defconfig; make' for busybox-w32 is identical to upstream BusyBox.
-rw-r--r-- | coreutils/sum.c | 2 | ||||
-rw-r--r-- | debianutils/pipe_progress.c | 9 | ||||
-rw-r--r-- | libbb/appletlib.c | 8 | ||||
-rw-r--r-- | shell/ash.c | 14 |
4 files changed, 28 insertions, 5 deletions
diff --git a/coreutils/sum.c b/coreutils/sum.c index dba8e8e76..a15d1932d 100644 --- a/coreutils/sum.c +++ b/coreutils/sum.c | |||
@@ -84,7 +84,7 @@ static unsigned sum_file(const char *file, unsigned type) | |||
84 | s = (r & 0xffff) + (r >> 16); | 84 | s = (r & 0xffff) + (r >> 16); |
85 | printf("%u %"LL_FMT"u %s\n", s, (total_bytes + 511) / 512, file); | 85 | printf("%u %"LL_FMT"u %s\n", s, (total_bytes + 511) / 512, file); |
86 | } else | 86 | } else |
87 | printf("%05u %5"OFF_FMT"u %s\n", s, (total_bytes + 1023) / 1024, file); | 87 | printf("%05u %5"LL_FMT"u %s\n", s, (total_bytes + 1023) / 1024, file); |
88 | return 1; | 88 | return 1; |
89 | #undef buf | 89 | #undef buf |
90 | } | 90 | } |
diff --git a/debianutils/pipe_progress.c b/debianutils/pipe_progress.c index fd08a145e..28c4fd70e 100644 --- a/debianutils/pipe_progress.c +++ b/debianutils/pipe_progress.c | |||
@@ -16,10 +16,11 @@ | |||
16 | 16 | ||
17 | //kbuild:lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o | 17 | //kbuild:lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o |
18 | 18 | ||
19 | //usage:#define pipe_progress_trivial_usage | 19 | //usage:#define pipe_progress_trivial_usage IF_PLATFORM_POSIX(NOUSAGE_STR) |
20 | //usage: "" | 20 | //usage: IF_PLATFORM_MINGW32("") |
21 | //usage:#define pipe_progress_full_usage "\n\n" | 21 | //usage:#define pipe_progress_full_usage IF_PLATFORM_POSIX("") |
22 | //usage: "Display a dot to indicate pipe activity" | 22 | //usage: IF_PLATFORM_MINGW32("\n\n") |
23 | //usage: IF_PLATFORM_MINGW32("Display a dot to indicate pipe activity") | ||
23 | 24 | ||
24 | #include "libbb.h" | 25 | #include "libbb.h" |
25 | 26 | ||
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index be243de79..b7e5e3f1f 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -160,7 +160,11 @@ void FAST_FUNC bb_show_usage(void) | |||
160 | ap--; | 160 | ap--; |
161 | } | 161 | } |
162 | full_write2_str(bb_banner); | 162 | full_write2_str(bb_banner); |
163 | #if ENABLE_PLATFORM_MINGW32 | ||
163 | full_write2_str(" multi-call binary\n"); | 164 | full_write2_str(" multi-call binary\n"); |
165 | #else | ||
166 | full_write2_str(" multi-call binary.\n"); /* common string */ | ||
167 | #endif | ||
164 | if (*p == '\b') | 168 | if (*p == '\b') |
165 | full_write2_str("\nNo help available\n"); | 169 | full_write2_str("\nNo help available\n"); |
166 | else { | 170 | else { |
@@ -869,7 +873,11 @@ int busybox_main(int argc UNUSED_PARAM, char **argv) | |||
869 | 873 | ||
870 | dup2(1, 2); | 874 | dup2(1, 2); |
871 | full_write2_str(bb_banner); /* reuse const string */ | 875 | full_write2_str(bb_banner); /* reuse const string */ |
876 | #if ENABLE_PLATFORM_MINGW32 | ||
872 | full_write2_str(" multi-call binary\n"); /* reuse */ | 877 | full_write2_str(" multi-call binary\n"); /* reuse */ |
878 | #else | ||
879 | full_write2_str(" multi-call binary.\n"); /* reuse */ | ||
880 | #endif | ||
873 | #if defined(MINGW_VER) | 881 | #if defined(MINGW_VER) |
874 | if (sizeof(MINGW_VER) > 5) { | 882 | if (sizeof(MINGW_VER) > 5) { |
875 | full_write2_str(MINGW_VER "\n\n"); | 883 | full_write2_str(MINGW_VER "\n\n"); |
diff --git a/shell/ash.c b/shell/ash.c index 89bd886d3..d63304bdb 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -462,7 +462,9 @@ struct globals_misc { | |||
462 | int rootpid; /* pid of main shell */ | 462 | int rootpid; /* pid of main shell */ |
463 | /* shell level: 0 for the main shell, 1 for its children, and so on */ | 463 | /* shell level: 0 for the main shell, 1 for its children, and so on */ |
464 | int shlvl; | 464 | int shlvl; |
465 | #if ENABLE_PLATFORM_MINGW32 | ||
465 | int loopnest; /* current loop nesting level */ | 466 | int loopnest; /* current loop nesting level */ |
467 | #endif | ||
466 | #define rootshell (!shlvl) | 468 | #define rootshell (!shlvl) |
467 | int errlinno; | 469 | int errlinno; |
468 | 470 | ||
@@ -472,7 +474,9 @@ struct globals_misc { | |||
472 | char *physdir; // = nullstr; /* physical working directory */ | 474 | char *physdir; // = nullstr; /* physical working directory */ |
473 | 475 | ||
474 | char *arg0; /* value of $0 */ | 476 | char *arg0; /* value of $0 */ |
477 | #if ENABLE_PLATFORM_MINGW32 | ||
475 | char *commandname; | 478 | char *commandname; |
479 | #endif | ||
476 | 480 | ||
477 | struct jmploc *exception_handler; | 481 | struct jmploc *exception_handler; |
478 | 482 | ||
@@ -551,12 +555,16 @@ extern struct globals_misc *BB_GLOBAL_CONST ash_ptr_to_globals_misc; | |||
551 | #define rootpid (G_misc.rootpid ) | 555 | #define rootpid (G_misc.rootpid ) |
552 | #define shlvl (G_misc.shlvl ) | 556 | #define shlvl (G_misc.shlvl ) |
553 | #define errlinno (G_misc.errlinno ) | 557 | #define errlinno (G_misc.errlinno ) |
558 | #if ENABLE_PLATFORM_MINGW32 | ||
554 | #define loopnest (G_misc.loopnest ) | 559 | #define loopnest (G_misc.loopnest ) |
560 | #endif | ||
555 | #define minusc (G_misc.minusc ) | 561 | #define minusc (G_misc.minusc ) |
556 | #define curdir (G_misc.curdir ) | 562 | #define curdir (G_misc.curdir ) |
557 | #define physdir (G_misc.physdir ) | 563 | #define physdir (G_misc.physdir ) |
558 | #define arg0 (G_misc.arg0 ) | 564 | #define arg0 (G_misc.arg0 ) |
565 | #if ENABLE_PLATFORM_MINGW32 | ||
559 | #define commandname (G_misc.commandname) | 566 | #define commandname (G_misc.commandname) |
567 | #endif | ||
560 | #define exception_handler (G_misc.exception_handler) | 568 | #define exception_handler (G_misc.exception_handler) |
561 | #define exception_type (G_misc.exception_type ) | 569 | #define exception_type (G_misc.exception_type ) |
562 | #define suppress_int (G_misc.suppress_int ) | 570 | #define suppress_int (G_misc.suppress_int ) |
@@ -1429,6 +1437,9 @@ struct parsefile { | |||
1429 | 1437 | ||
1430 | static struct parsefile basepf; /* top level input file */ | 1438 | static struct parsefile basepf; /* top level input file */ |
1431 | static struct parsefile *g_parsefile = &basepf; /* current input file */ | 1439 | static struct parsefile *g_parsefile = &basepf; /* current input file */ |
1440 | #if ENABLE_PLATFORM_POSIX | ||
1441 | static char *commandname; /* currently executing command */ | ||
1442 | #endif | ||
1432 | 1443 | ||
1433 | 1444 | ||
1434 | /* ============ Message printing */ | 1445 | /* ============ Message printing */ |
@@ -9486,6 +9497,9 @@ defun(union node *func) | |||
9486 | #define SKIPFUNC (1 << 2) | 9497 | #define SKIPFUNC (1 << 2) |
9487 | static smallint evalskip; /* set to SKIPxxx if we are skipping commands */ | 9498 | static smallint evalskip; /* set to SKIPxxx if we are skipping commands */ |
9488 | static int skipcount; /* number of levels to skip */ | 9499 | static int skipcount; /* number of levels to skip */ |
9500 | #if ENABLE_PLATFORM_POSIX | ||
9501 | static int loopnest; /* current loop nesting level */ | ||
9502 | #endif | ||
9489 | static int funcline; /* starting line number of current function, or 0 if not in a function */ | 9503 | static int funcline; /* starting line number of current function, or 0 if not in a function */ |
9490 | 9504 | ||
9491 | /* Forward decl way out to parsing code - dotrap needs it */ | 9505 | /* Forward decl way out to parsing code - dotrap needs it */ |