This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/libiberty] Add missing <sys/types.h> in unlink-if-ordinary.c


Mark Kettenis writes:
 > One really shouldn't include <sys/stat.h> without <sys/types.h> on
 > BSD-derived systems.  On most modern BSD's it is brought in by
 > <unistd.h> but vax-dec-ultrix4.0 doesn't have one, so things break.
 > The attached patch fixes that.
 > 

You must wrap this in #ifdef HAVE_SYS_TYPES_H

Andrew.


 > 
 > Index: ChangeLog
 > from  Mark Kettenis  <kettenis@gnu.org>
 > 
 > 	* unlink-if-ordinary.c: Include <sys/types.h>.
 > 
 > Index: unlink-if-ordinary.c
 > ===================================================================
 > RCS file: /cvs/src/src/libiberty/unlink-if-ordinary.c,v
 > retrieving revision 1.1
 > diff -u -p -r1.1 unlink-if-ordinary.c
 > --- unlink-if-ordinary.c 1 Mar 2005 14:33:00 -0000 1.1
 > +++ unlink-if-ordinary.c 26 Mar 2005 14:18:20 -0000
 > @@ -39,6 +39,8 @@ was made to unlink the file because it i
 >  #include "config.h"
 >  #endif
 >  
 > +#include <sys/types.h>
 > +
 >  #ifdef HAVE_UNISTD_H
 >  #include <unistd.h>
 >  #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]