[PATCH] gold: use open_descriptor in binary_unittest
Roland McGrath
mcgrathr@google.com
Fri Dec 7 21:37:00 GMT 2012
More information about the Binutils mailing list
Fri Dec 7 21:37:00 GMT 2012
- Previous message (by thread): PATCH: Add LTO tests
- Next message (by thread): [PATCH] gold: don't assume read/pread never return short counts
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
gold's binary_unittest fails on a system where O_BINARY is meaningful. Rather than just copy the knowledge of O_BINARY setting into the test code, I made it use open_descriptor like everything else does. Ok for trunk and 2.23? Thanks, Roland gold/ 2012-12-07 Roland McGrath <mcgrathr@google.com> * testsuite/binary_unittest.cc (Sized_binary_test): Use open_descriptor rather than ::open. --- 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);
- Previous message (by thread): PATCH: Add LTO tests
- Next message (by thread): [PATCH] gold: don't assume read/pread never return short counts
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list