[BusyBox] Include netinet/in.h in libbb.h [PATCH]

Shaun Jackman sjackman at gmail.com
Sun Jul 24 23:35:27 MDT 2005


On 4/6/05, Shaun Jackman <sjackman at gmail.com> wrote:
> On Apr 5, 2005 9:46 PM, Rob Landley <rob at landley.net> wrote:
> > On Tuesday 05 April 2005 01:56 pm, Shaun Jackman wrote:
> > > libbb.h uses struct sockaddr_in which is defined in netinet/in.h, so
> > > include it.
> >
> > Um, what does this fix?  (I'm fairly certain this already compiles...)
> 
> libbb.h uses struct sockaddr_in the declaration of two functions,
> xconnect and bb_lookup_host, but it does not declare the structure.

Since libbb.h uses struct sockaddr_in, it must include netinet/in.h.

In glibc, netdb.h includes netinet/in.h, but this is a side effect
unique to the GNU libc implementation and not a requirement of
netdb.h.

This patch is necessary to allow busybox to compile on other standard
implementations of libc that do not exhibit this unique behaviour

Cheers,
Shaun

2005-04-05  Shaun Jackman  <sjackman at gmail.com>

       * include/libbb.h: Include netinet/in.h for struct sockaddr_in.

Index: include/libbb.h
===================================================================
--- include/libbb.h     (revision 10071)
+++ include/libbb.h     (working copy)
@@ -34,6 +34,7 @@
 #include <stdint.h>

  #include <netdb.h>
+#include <netinet/in.h>

  #ifdef DMALLOC
 #include <dmalloc.h>


More information about the busybox mailing list