This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[GOLD][PATCH] Fix sys/uio.h include in fileread.cc


Hello Ian,

please find attached a patch that fixes an including of sys/uio.h when
if HAVE_READV is not defined. It prevents some compilation errors on the
system, which don't have this file. Also it fixes a syntax error in the
iovec definition.

-Viktor

Index: fileread.cc
===================================================================
RCS file: /cvs/src/src/gold/fileread.cc,v
retrieving revision 1.63
diff -u -r1.63 fileread.cc
--- fileread.cc	24 Mar 2010 01:27:57 -0000	1.63
+++ fileread.cc	11 Jun 2010 17:44:37 -0000
@@ -27,7 +27,11 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/mman.h>
+
+#ifdef HAVE_READV
 #include <sys/uio.h>
+#endif
+
 #include <sys/stat.h>
 #include "filenames.h"
 
@@ -42,7 +46,7 @@
 #include "fileread.h"
 
 #ifndef HAVE_READV
-struct iovec { void* iov_base; size_t iov_len };
+struct iovec { void* iov_base; size_t iov_len; };
 ssize_t
 readv(int, const iovec*, int)
 {

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