Changeset View
Changeset View
Standalone View
Standalone View
x11/sddm/files/patch-src_helper_HelperApp.cpp
--- src/helper/HelperApp.cpp.orig 2017-12-05 16:00:16 UTC | --- src/helper/HelperApp.cpp.orig 2019-03-13 09:22:35 UTC | ||||
+++ src/helper/HelperApp.cpp | +++ src/helper/HelperApp.cpp | ||||
@@ -33,8 +33,11 @@ | @@ -35,7 +35,9 @@ | ||||
#include <iostream> | |||||
#include <unistd.h> | |||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
+#include <sys/time.h> | #include <sys/time.h> | ||||
+#if defined(Q_OS_LINUX) | +#if defined(Q_OS_LINUX) | ||||
#include <utmp.h> | #include <utmp.h> | ||||
+#endif | +#endif | ||||
#include <utmpx.h> | #include <utmpx.h> | ||||
#include <QByteArray> | #include <QByteArray> | ||||
@@ -301,12 +304,20 @@ namespace SDDM { | @@ -302,12 +304,20 @@ namespace SDDM { | ||||
// append to failed login database btmp | // append to failed login database btmp | ||||
if (!authSuccessful) { | if (!authSuccessful) { | ||||
+#if defined(Q_OS_FREEBSD) | +#if defined(Q_OS_FREEBSD) | ||||
+ pututxline(&entry); | + pututxline(&entry); | ||||
+#else | +#else | ||||
updwtmpx("/var/log/btmp", &entry); | updwtmpx("/var/log/btmp", &entry); | ||||
+#endif | +#endif | ||||
} | } | ||||
// append to wtmp | // append to wtmp | ||||
else { | else { | ||||
+#if defined(Q_OS_FREEBSD) | +#if defined(Q_OS_FREEBSD) | ||||
+ pututxline(&entry); | + pututxline(&entry); | ||||
+#else | +#else | ||||
updwtmpx("/var/log/wtmp", &entry); | updwtmpx("/var/log/wtmp", &entry); | ||||
+#endif | +#endif | ||||
} | } | ||||
} | } | ||||
@@ -342,8 +353,12 @@ namespace SDDM { | @@ -343,8 +353,12 @@ namespace SDDM { | ||||
qWarning() << "Failed to write utmpx: " << strerror(errno); | qWarning() << "Failed to write utmpx: " << strerror(errno); | ||||
endutxent(); | endutxent(); | ||||
+#if defined(Q_OS_FREEBSD) | +#if defined(Q_OS_FREEBSD) | ||||
+ pututxline(&entry); | + pututxline(&entry); | ||||
+#else | +#else | ||||
// append to wtmp | // append to wtmp | ||||
updwtmpx("/var/log/wtmp", &entry); | updwtmpx("/var/log/wtmp", &entry); | ||||
+#endif | +#endif | ||||
} | } | ||||
} | } | ||||