[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT/LWIP PATCH] Fix some compilation errors and warnings that are generated with nolibc
As the title says, this should be tested with nolibc. Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> --- getnameinfo.c | 5 +++++ inet.c | 2 ++ proto.c | 1 + serv.c | 1 + 4 files changed, 9 insertions(+) diff --git a/getnameinfo.c b/getnameinfo.c index 13f7d1e..d4a8a8f 100644 --- a/getnameinfo.c +++ b/getnameinfo.c @@ -54,6 +54,7 @@ * ---------------------------------------------------------------------- */ #include <stdio.h> +#include <sys/socket.h> #include <netdb.h> #include <arpa/inet.h> @@ -65,8 +66,10 @@ int getnameinfo(const struct sockaddr *restrict sa, socklen_t sl, char buf[256]; /*unsigned char reply[512]; TODO used in DNS reply */ int af = sa->sa_family; +#if CONFIG_LIBNEWLIBC /* because of fopen() */ char line[512]; FILE *f; +#endif unsigned char *a; switch (af) { @@ -86,6 +89,7 @@ int getnameinfo(const struct sockaddr *restrict sa, socklen_t sl, return EAI_FAMILY; } +#if CONFIG_LIBNEWLIBC /* because of fopen() */ /* Try to find ip within /etc/hosts */ if ((node && nodelen) && (af == AF_INET)) { const char *ipstr; @@ -117,6 +121,7 @@ int getnameinfo(const struct sockaddr *restrict sa, socklen_t sl, if (f) fclose(f); } +#endif if (node && nodelen) { if ((flags & NI_NUMERICHOST) diff --git a/inet.c b/inet.c index 903b676..fd3f8c4 100644 --- a/inet.c +++ b/inet.c @@ -31,6 +31,8 @@ * * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. */ + +#include <sys/socket.h> #include <netdb.h> diff --git a/proto.c b/proto.c index 9794300..517f258 100644 --- a/proto.c +++ b/proto.c @@ -21,6 +21,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include <sys/socket.h> #include <netdb.h> #include <string.h> diff --git a/serv.c b/serv.c index 555e3a6..b273def 100644 --- a/serv.c +++ b/serv.c @@ -31,6 +31,7 @@ * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. */ +#include <sys/socket.h> #include <netdb.h> struct servent *getservbyname(const char *name __unused, -- 2.20.1 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |