termux-packages/x11-packages/qtermwidget/utmp_android.patch
Leonid Pliushch 1455972447
enable some qt5-dependent packages
%ci:no-build
2022-04-18 14:48:04 +05:30

50 lines
945 B
Diff

--- src/lib/kpty.cpp 2021-05-12 15:09:15.461686000 +0000
+++ src.mod/lib/kpty.cpp 2021-05-12 15:24:03.750599000 +0000
@@ -32,6 +32,10 @@
#define HAVE_LIBUTIL_H
#endif
+#if defined(__ANDROID__)
+#define HAVE_PTY_H
+#endif
+
#if defined(__OpenBSD__)
#define HAVE_LOGIN
#define HAVE_UTIL_H
@@ -588,10 +592,12 @@
# endif
# else
utmpname(_PATH_UTMP);
+#ifndef __ANDROID__
setutent();
pututline(&l_struct);
endutent();
updwtmp(_PATH_WTMP, &l_struct);
+#endif
# endif
# endif
#endif
@@ -641,7 +647,12 @@
# else
utmpname(_PATH_UTMP);
setutent();
+
+#ifndef __ANDROID__
if ((ut = getutline(&l_struct))) {
+#else
+ if ((ut = getutent())) {
+#endif
# endif
# ifdef HAVE_UTMPX
memset(ut->ut_user, 0, sizeof(*ut->ut_user));
@@ -662,7 +673,9 @@
endutxent();
# else
ut->ut_time = time(nullptr);
+#ifndef __ANDROID__
pututline(ut);
+#endif
}
endutent();
# endif