Skip to content

Commit 80ee3c2

Browse files
committed
The option QIODevice::ExistingOnly required Qt 5.11+, option is not required for ReadOnly open.
This is quick fix to resolve problem with ancient Qt libraries included in older GNU{Linux distributions. Signed-off-by: Pavel Pisa <[email protected]>
1 parent 24fa331 commit 80ee3c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

qtmips_machine/programloader.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ ProgramLoader::ProgramLoader(QString file) : elf_file(file) {
5252
// Initialize elf library
5353
if (elf_version(EV_CURRENT) == EV_NONE)
5454
throw QTMIPS_EXCEPTION(Input, "Elf library initialization failed", elf_errmsg(-1));
55-
// Open source file
56-
if (!elf_file.open(QIODevice::ReadOnly | QIODevice::Unbuffered | QIODevice::ExistingOnly))
55+
// Open source file - option QIODevice::ExistingOnly cannot be used on Qt <5.11
56+
if (!elf_file.open(QIODevice::ReadOnly | QIODevice::Unbuffered))
5757
throw QTMIPS_EXCEPTION(Input, QString("Can't open input elf file for reading (") + QString(file) + QString(")"), std::strerror(errno));
5858
// Initialize elf
5959
if (!(this->elf = elf_begin(elf_file.handle(), ELF_C_READ, NULL)))

0 commit comments

Comments
 (0)