Commit ca0e2ea2 authored by Kwon-Young Choi's avatar Kwon-Young Choi

close file descriptor

parent 7be96eae
......@@ -21,6 +21,8 @@
#include "mountisoaction.h"
#include <fcntl.h>
#include <unistd.h>
#include <error.h>
#include <sys/stat.h>
#include <sys/types.h>
......@@ -91,10 +93,15 @@ void mount(const QString &file)
{
const int fd = open(file.toLocal8Bit().data(), O_RDONLY);
if (fd == -1) {
qWarning() << "Error opening " << file;
qWarning() << "Error opening " << file << ": " << strerror(errno);
return;
}
auto qtFd = QDBusUnixFileDescriptor(fd);
int res = close(fd);
if (res == -1) {
qWarning() << "Error closing " << file << ": " << strerror(errno);
return;
}
QMap<QString, QVariant> options;
options["read-only"] = QVariant::fromValue(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment