Commit d7e9c717 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Explicitly cast major() and minor() to uints

On FreeBSD, the major() and the minor() macros return ints instead of
uints.
parent ba0e1895
......@@ -171,7 +171,8 @@ int ConsoleKitSession::openRestricted(const QString &fileName)
QDBusMessage message = QDBusMessage::createMethodCall(s_serviceName, m_sessionPath,
s_sessionInterface,
QStringLiteral("TakeDevice"));
message.setArguments({ major(st.st_rdev), minor(st.st_rdev) });
// major() and minor() macros return ints on FreeBSD instead of uints.
message.setArguments({uint(major(st.st_rdev)), uint(minor(st.st_rdev))});
const QDBusMessage reply = QDBusConnection::systemBus().call(message);
if (reply.type() == QDBusMessage::ErrorMessage) {
......@@ -199,7 +200,8 @@ void ConsoleKitSession::closeRestricted(int fileDescriptor)
QDBusMessage message = QDBusMessage::createMethodCall(s_serviceName, m_sessionPath,
s_sessionInterface,
QStringLiteral("ReleaseDevice"));
message.setArguments({ major(st.st_rdev), minor(st.st_rdev) });
// major() and minor() macros return ints on FreeBSD instead of uints.
message.setArguments({uint(major(st.st_rdev)), uint(minor(st.st_rdev))});
QDBusConnection::systemBus().asyncCall(message);
......
......@@ -177,7 +177,8 @@ int LogindSession::openRestricted(const QString &fileName)
QDBusMessage message = QDBusMessage::createMethodCall(s_serviceName, m_sessionPath,
s_sessionInterface,
QStringLiteral("TakeDevice"));
message.setArguments({ major(st.st_rdev), minor(st.st_rdev) });
// major() and minor() macros return ints on FreeBSD instead of uints.
message.setArguments({uint(major(st.st_rdev)), uint(minor(st.st_rdev))});
const QDBusMessage reply = QDBusConnection::systemBus().call(message);
if (reply.type() == QDBusMessage::ErrorMessage) {
......@@ -205,7 +206,8 @@ void LogindSession::closeRestricted(int fileDescriptor)
QDBusMessage message = QDBusMessage::createMethodCall(s_serviceName, m_sessionPath,
s_sessionInterface,
QStringLiteral("ReleaseDevice"));
message.setArguments({ major(st.st_rdev), minor(st.st_rdev) });
// major() and minor() macros return ints on FreeBSD instead of uints.
message.setArguments({uint(major(st.st_rdev)), uint(minor(st.st_rdev))});
QDBusConnection::systemBus().asyncCall(message);
......
Supports Markdown
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