summaryrefslogtreecommitdiff
path: root/gold/testsuite
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2012-12-07 21:48:31 +0000
committerRoland McGrath <roland@gnu.org>2012-12-07 21:48:31 +0000
commita3399f8a3657f5cdb61616aa88a7faeb6832064d (patch)
treee0b48133622419eff786098bcd1d5551cc5aef75 /gold/testsuite
parent0fc07dd28f02b454b9190478e5a55e4851092b6f (diff)
downloadbinutils-redhat-a3399f8a3657f5cdb61616aa88a7faeb6832064d.tar.gz
gold/
* testsuite/binary_unittest.cc (Sized_binary_test): Use open_descriptor rather than ::open.
Diffstat (limited to 'gold/testsuite')
-rw-r--r--gold/testsuite/binary_unittest.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gold/testsuite/binary_unittest.cc b/gold/testsuite/binary_unittest.cc
index a9f47c20fc..6e7b244121 100644
--- a/gold/testsuite/binary_unittest.cc
+++ b/gold/testsuite/binary_unittest.cc
@@ -1,6 +1,6 @@
// binary_unittest.cc -- test Binary_to_elf
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008, 2012 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
@@ -33,6 +33,7 @@
#include "options.h"
#include "binary.h"
#include "object.h"
+#include "descriptors.h"
#include "test.h"
#include "testfile.h"
@@ -53,7 +54,7 @@ Sized_binary_test()
// Use the executable itself as the binary data.
struct stat st;
CHECK(::stat(gold::program_name, &st) == 0);
- int o = ::open(gold::program_name, O_RDONLY);
+ int o = open_descriptor(-1, gold::program_name, O_RDONLY);
CHECK(o >= 0);
unsigned char* filedata = new unsigned char[st.st_size];
CHECK(::read(o, filedata, st.st_size) == st.st_size);