aboutsummaryrefslogtreecommitdiff
path: root/gold/descriptors.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-10-10 04:56:43 +0000
committerIan Lance Taylor <ian@airs.com>2009-10-10 04:56:43 +0000
commitf3048a1d4770f01625461c6d967a774f5a3f8496 (patch)
treeeca9d1b7a91be25e92e33bd76ac88c277aab933e /gold/descriptors.cc
parentec2d9b29273a260dad374eca5bbe2f7922d0bfde (diff)
downloadgdb-f3048a1d4770f01625461c6d967a774f5a3f8496.zip
gdb-f3048a1d4770f01625461c6d967a774f5a3f8496.tar.gz
gdb-f3048a1d4770f01625461c6d967a774f5a3f8496.tar.bz2
* descriptor.cc: Include <cstdio> and "binary-io.h".
(Descriptors::open): Open the files in binary mode always. * script.cc (Lex::get_token): Treat \r as whitespace.
Diffstat (limited to 'gold/descriptors.cc')
-rw-r--r--gold/descriptors.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gold/descriptors.cc b/gold/descriptors.cc
index 3d059e2..f4a02d0 100644
--- a/gold/descriptors.cc
+++ b/gold/descriptors.cc
@@ -23,6 +23,7 @@
#include "gold.h"
#include <cerrno>
+#include <cstdio>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
@@ -31,6 +32,7 @@
#include "options.h"
#include "gold-threads.h"
#include "descriptors.h"
+#include "binary-io.h"
// Very old systems may not define FD_CLOEXEC.
#ifndef FD_CLOEXEC
@@ -98,6 +100,9 @@ Descriptors::open(int descriptor, const char* name, int flags, int mode)
// require callers to pass it.
flags |= O_CLOEXEC;
+ // Always open the file as a binary file.
+ flags |= O_BINARY;
+
int new_descriptor = ::open(name, flags, mode);
if (new_descriptor < 0
&& errno != ENFILE