summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2016-03-22 00:19:20 (GMT)
committerTony Theodore <tonyt@logyst.com>2016-03-22 00:19:20 (GMT)
commit34451075836cdd23cb03b69ef285cf4a4ac9489f (patch)
tree7acd4ef4b434e1fbfa47c36d7c2c3a7f78603b77
parent726d6af5cfadfd6798215c7ba11f0b2befe48f7b (diff)
parent2dd817b395a30cbae8e841b61ed1dd0d6e3ca585 (diff)
downloadmxe-34451075836cdd23cb03b69ef285cf4a4ac9489f.zip
mxe-34451075836cdd23cb03b69ef285cf4a4ac9489f.tar.gz
mxe-34451075836cdd23cb03b69ef285cf4a4ac9489f.tar.bz2
Merge pull request #1270 from LuaAndC/nonetwork-print-message
nonetwork: print message from replaced functions
-rw-r--r--tools/nonetwork.c11
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;
}