Index: ports/nacl-spawn/elf_reader.cc |
diff --git a/ports/nacl-spawn/elf_reader.cc b/ports/nacl-spawn/elf_reader.cc |
index 00367a080c9861de5d9f7927fdb2c8f79fc3f13b..1654a02e495bea3e1ee88f1fc7f7023910a38633 100644 |
--- a/ports/nacl-spawn/elf_reader.cc |
+++ b/ports/nacl-spawn/elf_reader.cc |
@@ -33,7 +33,7 @@ ElfReader::ElfReader(const char* filename) |
: filename_(filename), is_valid_(false), is_static_(false) { |
ScopedFile fp(fopen(filename, "rb")); |
if (!fp.get()) { |
- PrintError("failed to open file"); |
+ PrintError("failed to open file: %s", strerror(errno)); |
return; |
} |
@@ -247,10 +247,7 @@ void ElfReader::PrintError(const char* fmt, ...) { |
if (written >= kBufSize) |
buf[kBufSize-1] = '\0'; |
- if (errno) |
- fprintf(stderr, "%s: %s: %s\n", filename_, buf, strerror(errno)); |
- else |
- fprintf(stderr, "%s: %s\n", filename_, buf); |
+ fprintf(stderr, "%s: %s\n", filename_, buf); |
} |
#if defined(DEFINE_ELF_READER_MAIN) |