This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[GOLD][PATCH] Fix sys/uio.h include in fileread.cc
- From: Viktor Kutuzov <vkutuzov at accesssoftek dot com>
- To: Ian Lance Taylor <iant at google dot com>, binutils <binutils at sourceware dot org>
- Date: Fri, 11 Jun 2010 12:19:27 -0700
- Subject: [GOLD][PATCH] Fix sys/uio.h include in fileread.cc
- Reply-to: <vkutuzov at accesssoftek dot com>
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)
{