sddm: stub sddm-helper utmp/utmpx login accounting for Redox
src/helper/HelperApp.cpp includes <utmpx.h> and writes utmpx login/logout records (setutxent/pututxline/updwtmpx). Redox has no utmp/utmpx login-accounting database -> "fatal error: utmpx.h: No such file". Guard the include and the utmpLogin/utmpLogout bodies under __redox__ as no-ops (login records are not tracked on Redox). The sddm daemon already links; this unblocks sddm-helper.
This commit is contained in:
@@ -13,6 +13,9 @@ patches = [
|
||||
# Redox has no Linux/FreeBSD VT subsystem (VT_ACTIVATE/VT_WAITACTIVE/KDSETMODE
|
||||
# etc.); stub SDDM::VirtualTerminal to no-ops (greeter runs on the compositor).
|
||||
"redox-virtualterminal-stub.patch",
|
||||
# Redox has no utmp/utmpx login-accounting DB; stub sddm-helper's
|
||||
# utmpLogin/utmpLogout to no-ops (skip <utmpx.h>).
|
||||
"redox-helper-utmpx-stub.patch",
|
||||
]
|
||||
|
||||
[build]
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
--- a/src/helper/HelperApp.cpp
|
||||
+++ b/src/helper/HelperApp.cpp
|
||||
@@ -41,7 +41,9 @@
|
||||
#if defined(Q_OS_LINUX)
|
||||
#include <utmp.h>
|
||||
#endif
|
||||
+#if !defined(__redox__)
|
||||
#include <utmpx.h>
|
||||
+#endif
|
||||
#include <QByteArray>
|
||||
#include <signal.h>
|
||||
|
||||
@@ -301,6 +303,10 @@
|
||||
}
|
||||
|
||||
void HelperApp::utmpLogin(const QString &vt, const QString &displayName, const QString &user, qint64 pid, bool authSuccessful) {
|
||||
+#if defined(__redox__)
|
||||
+ // Redox has no utmp/utmpx login-accounting database; no-op.
|
||||
+ Q_UNUSED(vt); Q_UNUSED(displayName); Q_UNUSED(user); Q_UNUSED(pid); Q_UNUSED(authSuccessful);
|
||||
+#else
|
||||
struct utmpx entry { };
|
||||
struct timeval tv;
|
||||
|
||||
@@ -339,9 +345,14 @@
|
||||
#if defined(Q_OS_LINUX)
|
||||
updwtmpx(authSuccessful ? "/var/log/wtmp" : "/var/log/btmp", &entry);
|
||||
#endif
|
||||
+#endif // !__redox__
|
||||
}
|
||||
|
||||
void HelperApp::utmpLogout(const QString &vt, const QString &displayName, qint64 pid) {
|
||||
+#if defined(__redox__)
|
||||
+ // Redox has no utmp/utmpx login-accounting database; no-op.
|
||||
+ Q_UNUSED(vt); Q_UNUSED(displayName); Q_UNUSED(pid);
|
||||
+#else
|
||||
struct utmpx entry { };
|
||||
struct timeval tv;
|
||||
|
||||
@@ -378,6 +389,7 @@
|
||||
#elif defined(Q_OS_FREEBSD)
|
||||
pututxline(&entry);
|
||||
#endif
|
||||
+#endif // !__redox__
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user