This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH/libiberty] Add missing <sys/types.h> in unlink-if-ordinary.c
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gcc-patches at gcc dot gnu dot org
- Cc: binutils at sourceware dot org, gdb at sourceware dot org
- Date: Sat, 26 Mar 2005 15:21:06 +0100 (CET)
- Subject: [PATCH/libiberty] Add missing <sys/types.h> in unlink-if-ordinary.c
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.
ok?
Mark
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