[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


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Thu, 29 Aug 2019 17:07:14 +0300
  • Cc: felipe.huici@xxxxxxxxx
  • Delivery-date: Thu, 29 Aug 2019 14:07:48 +0000
  • Ironport-phdr: 9a23:HJ0cihW94tO0TcxvtuU6Mxv3sODV8LGtZVwlr6E/grcLSJyIuqrYbBWFt8tkgFKBZ4jH8fUM07OQ7/m6HzVeu93f4TgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrswndrNQajIp8Jqo+yxbEpmZDdvhLy29vOV+dhQv36N2q/J5k/SRQuvYh+NBFXK7nYak2TqFWASo/PWwt68LlqRfMTQ2U5nsBSWoWiQZHAxLE7B7hQJj8tDbxu/dn1ymbOc32Sq00WSin4qx2RhLklDsLOjgk+2zRl8d+jr9UoAi5qhJ/3YDafY+bOvl5cK7GYd8WWXBMUtpLWiBdHo+xaZYEAeobPeZfqonwv0UDrRylBQmwBePvzCJDiHnr3a0izuQqDAbL0xAnH9IVrHTUrdP1OL0WUeCo1KnI0C7OYO9N2Tvn8IjIbwsureuWXbJ3aMfcz1QkGQDdjliItIDoMC6Z2v4OvmWb9eZsS/yjhmw9pwx/ujSj28ghhpTTio8Wyl3I7zt1zYg7KNGiVUJ2bsCoHZ1NvC+ALYR2WNktQ2RwtSY/zb0JpIC0cTARyJQi2x7fc/uHc5WU4h77VOaePzN4hHV9dbKhgha960mgyunmWsaoy1ZGtDJFksTXuXwXzRzT7dCLSvp7/ki/xTaCzx3f5+5ZLUwulqfWK4QtzqAumpcRq0jOEDf6mEDsg6+XckUk9PKo6+PiYrj+upCcMJR0ih3/MqQogMC/Bfk4MhATX2WA5eu8z6fv/VXkQLpRlPE2iK7ZvIjAJcsHvq65HxNV0oE75ha6Djem1tUYnX4cLF5cZR2IkZbpNE/KIP3jCfe/gk+skCtwx/zcMbzuHJPNImLEkLf7crZ381RcxxYrzdBD+5JUDakMIPztVU/1tdzYFgE2Pxa0w+b6CdVyyoIeVHmJAqCHLKzStUWH6fk1L+aSeY9G8Ar6fv0k4f/pljo1lEEQeYGt3IALczaoE/IgJF+WMlT2hdJUOmARogs4BMj3kEDKBTVUfGqzWeQ4+ykmIIm9S5/eTMa3h+rSj2+AApRKazUeWRi3GnDyetDcVg==
  • Ironport-sdr: uZZK9so025XVJ6nGUZ7aOdiHSlRgGCCdmyIPk93lr3BS/ovbBBaCNIRVwpG0+sEg6dwu8ZMH8h TIiuvgbOc5/g==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.