[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Tue Nov 26 15:57:56 MST 2013

On Tue, 2013-11-26 at 20:24 +0100, Christian Ambach wrote:
> Hi Jelmer,
> Am 22.11.13 00:18, schrieb Jelmer Vernooij:
> >> +/* for struct stat */
> >> +#include <sys/stat.h>
> >> +
> >
> > We generally try to keep platform-specific includes like this in
> > lib/replace/system. Would it perhaps make sense to include
> > system/filesys.h instead?
> There is no real platform-specific include involved here, and I chose to
> directly use sys/stat.h here as it is part of the Open Group standards
> (and so it should be available virtually everywhere) and it is also
> included directly at other places in the Samba source tree.

We shouldn't be doing that.  We should always go via our system headers.

> lib/replace/system/filesys.h also unconditionally includes <sys/stat.h>,
> so I did not see the need to use the replace header.

We do it to be consistent.  

> AIX has some specialities, i.e. it redefines struct stat as struct
> stat64 in the system headers and this is what caused the breakage here:
> our header did some forward declaration and the code that implemented
> the prototype then included the system header and so declared an
> argument that was incompatible to the prototype.
> IMHO, we should avoid forward declarations of system data structures to
> prevent this from happening again.

Yes, we should avoid those, but we should also always use the libreplace

Andrew Bartlett

Andrew Bartlett
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba

More information about the samba-technical mailing list