diff options
author | Boris Nagaev <bnagaev@gmail.com> | 2016-03-20 22:11:38 (GMT) |
---|---|---|
committer | Boris Nagaev <bnagaev@gmail.com> | 2016-03-20 22:11:38 (GMT) |
commit | 2dd817b395a30cbae8e841b61ed1dd0d6e3ca585 (patch) | |
tree | 33cf2d746db46028c82487a2fa57c6f21f150ef9 | |
parent | 8ae971a5e9e37f7f7faabcb0868585308246d3af (diff) | |
download | mxe-2dd817b395a30cbae8e841b61ed1dd0d6e3ca585.zip mxe-2dd817b395a30cbae8e841b61ed1dd0d6e3ca585.tar.gz mxe-2dd817b395a30cbae8e841b61ed1dd0d6e3ca585.tar.bz2 |
nonetwork: print message from replaced functions
See https://github.com/mxe/mxe/issues/1269
-rw-r--r-- | tools/nonetwork.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/nonetwork.c b/tools/nonetwork.c index d203fb2..fb3dafb 100644 --- a/tools/nonetwork.c +++ b/tools/nonetwork.c @@ -4,33 +4,44 @@ // License: MIT #include <errno.h> +#include <stdio.h> + +static void print_message() { + fprintf(stderr, "Don't use network from MXE build rules!\n"); +} int connect(int sock, const void *addr, unsigned int len) { + print_message(); errno = 13; // EACCES, Permission denied return -1; } void *gethostbyname(const char *name) { + print_message(); return 0; } int getaddrinfo(const char *node, const char *service, const void *hints, void **res) { + print_message(); return -4; // EAI_FAIL } void freeaddrinfo(void *res) { + print_message(); } int getnameinfo(const void * sa, unsigned int salen, char * host, unsigned int hostlen, char * serv, unsigned int servlen, int flags) { + print_message(); return -4; // EAI_FAIL } struct hostent *gethostbyaddr(const void *addr, unsigned int len, int type) { + print_message(); return 0; } |