diff options
author | Tony Theodore <tonyt@logyst.com> | 2021-01-11 10:37:45 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2021-01-12 05:45:24 (GMT) |
commit | a6dc6350fd20ec3c55a1b884e2b7f8e58568211d (patch) | |
tree | ba754d656088f9cf4b2ff3d448b02697e7a921ae | |
parent | 36b3fe43452a7e3c4d579ad405380ab6e4bace6c (diff) | |
download | mxe-a6dc6350fd20ec3c55a1b884e2b7f8e58568211d.zip mxe-a6dc6350fd20ec3c55a1b884e2b7f8e58568211d.tar.gz mxe-a6dc6350fd20ec3c55a1b884e2b7f8e58568211d.tar.bz2 |
nonetwork.c: enable silent mode for scripts reading stderr
There's no obvious way to document this upfront since it should only
be used in very rare cases.
see #2590
-rw-r--r-- | tools/nonetwork.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/nonetwork.c b/tools/nonetwork.c index fc95b6a..9ddf598 100644 --- a/tools/nonetwork.c +++ b/tools/nonetwork.c @@ -5,11 +5,17 @@ #include <errno.h> #include <stdio.h> +#include <stdlib.h> static void print_message() { - fflush(stderr); - fprintf(stderr, "\nDon't use network from MXE build rules!\n"); - fflush(stderr); + if(getenv("MXE_SILENT_NO_NETWORK")) { + } else { + fflush(stderr); + fprintf(stderr, "\nDon't use network from MXE build rules!\n"); + fprintf(stderr, "\tSilent mode for scripts reading stderr into variables:\n"); + fprintf(stderr, "\t\tMXE_SILENT_NO_NETWORK= make ...\n"); + fflush(stderr); + } } int connect(int sock, const void *addr, unsigned int len) { |