[PATCH] Clean up samba-3.0 for POSIX-96

Green, Paul Paul.Green at stratus.com
Wed Jun 5 10:13:24 GMT 2002

Gerald (Jerry) Carter [mailto:jerry at samba.org] writes:
> On Fri, 31 May 2002 Paul_GreenVOS at vos.stratus.com wrote:
> > source/lib/interfaces.c       conditionally include sys/time.h and 
> >				sys/sockio.h (autoconf macros 
> already exist)
> This change broke SAMBA_2_2.  The reason is that lib/interfaces.c
> is used in the autoconf test so sys/sockio.h would never be
> included.  Any thoughts?  I've removed it from 2.2. for now
> and will look into it some more.

Try this patch.  I copied the #include of sys/sockio.h inside of the 3
ifdef'd regions that need it. This kind of even makes sense, because now on
systems that don't implement any of the 3 ways of determining the
interfaces, they don't need sys/sockio.h.  (And we don't implement any of
the 3 ways, and don't have this header).  This should be a safe patch for

Now that I see what is going on, and where I went wrong, I can't help but
notice that there is another HAVE_xxx macro referenced before #include
"config.h" (HAVE_SYS_TIME_H).  I took a brief look at configure, and it does
not appear to ever set HAVE_SYS_TIME_H.  But I also see some logic about
site-config files, so perhaps that's a way. At any rate, since I don't need
to change this, and since it is presumably not harming anyone, I have left
it alone.  There are also some other HAVE_xxx macros after the #include of
"config.h" but again, I left these alone.

I re-ran configure and make after this change, and both work ok.  This patch
is against the 2.2.4 sources prior to my previous change (I assume that's
where you backed the file up to).

If my changes were applied to the 3.0 tree, then this change needs to be
made there too.


--- oldsamba>source>lib>interfaces.c	Wed Jun  5 12:57:57 2002
+++ newsamba>source>lib>interfaces.c	Wed Jun  5 12:58:11 2002
@@ -44,10 +44,6 @@
 #include <net/if.h>
-#include <sys/sockio.h>
 struct iface_struct {
 	char name[16];
@@ -81,6 +77,10 @@ struct iface_struct {
+#include <sys/sockio.h>
 /* this works for Linux 2.2, Solaris 2.5, SunOS4, HPUX 10.20, OSF1
    V4.0, Ultrix 4.4, SCO Unix 3.2, IRIX 6.4 and FreeBSD 3.2.
@@ -153,6 +153,10 @@ static int _get_interfaces(struct iface_
+#include <sys/sockio.h>
 #ifndef I_STR
 #include <sys/stropts.h>
@@ -247,6 +251,10 @@ static int _get_interfaces(struct iface_
+#include <sys/sockio.h>
 this one is for AIX (tested on 4.2)

### END OF PATCH ###

Paul Green, Senior Technical Consultant, Stratus Technologies.
Voice: +1 978-461-7557; FAX: +1 978-461-3610; Video on request.

More information about the samba-technical mailing list