[BusyBox] Include netinet/in.h in libbb.h [PATCH]
Shaun Jackman
sjackman at gmail.com
Wed Apr 6 15:48:47 UTC 2005
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.
This patch fixes this problem.
libbb.h includes netdb.h, which may make the symbols from netinet/in.h
visible. So, it may compile under some implementations and will not
compile under other implementations.
> If you're going to add the #include to libbb, do you want to remove it from
> libbb/xconnect.c then?
If a source file uses a system header, I prefer to include it
explicitly rather than rely on a local header to include it. libbb.h
may currently include netinet/in.h, but that may not be always the
case. There are a number (22 by my count) of other files that include
libbb.h or busybox.h as well as netinet/in.h.
Cheers,
Shaun
More information about the busybox
mailing list