diff --git a/src/session_consolekit.cpp b/src/session_consolekit.cpp index 6fe7fcd31e..c7df93a60a 100644 --- a/src/session_consolekit.cpp +++ b/src/session_consolekit.cpp @@ -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); diff --git a/src/session_logind.cpp b/src/session_logind.cpp index fc94f56434..b424f1a9f0 100644 --- a/src/session_logind.cpp +++ b/src/session_logind.cpp @@ -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);