summaryrefslogtreecommitdiff
path: root/aports/busybox/0004-Avoid-redefined-warnings-when-buiding-with-utmps.patch
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2023-08-03 10:10:44 +0200
committerPÁLI Gábor János <pali.gabor@gmail.com>2023-09-16 17:58:03 +0200
commit89279d87c5d3e0ea330be1f927e3f3bc59dbc2a7 (patch)
tree353bc9a026d0140151e760efbc4f6a6a6b24a020 /aports/busybox/0004-Avoid-redefined-warnings-when-buiding-with-utmps.patch
parent084335e136581edc28137b152cc559778224570e (diff)
downloadfreebsd-wifibox-alpine-89279d87c5d3e0ea330be1f927e3f3bc59dbc2a7.zip
Update to Linux 6.1 and Alpine 3.18
- Update base-layout to 3.4.3 - Update busybox to 1.36.1 - Update iptables to 1.8.9 - Update linux-lts to 6.1.53 - Update to openrc to 0.48 - Update rtl8821ce to snapshot of 20230915 - Replace rtwB88 with a third-party driver - Update rtw89 to snapshot of 20230913 - Import wpa_supplicant fixes from Arch Linux
Diffstat (limited to 'aports/busybox/0004-Avoid-redefined-warnings-when-buiding-with-utmps.patch')
-rw-r--r--aports/busybox/0004-Avoid-redefined-warnings-when-buiding-with-utmps.patch108
1 files changed, 108 insertions, 0 deletions
diff --git a/aports/busybox/0004-Avoid-redefined-warnings-when-buiding-with-utmps.patch b/aports/busybox/0004-Avoid-redefined-warnings-when-buiding-with-utmps.patch
new file mode 100644
index 0000000..b0f2b45
--- /dev/null
+++ b/aports/busybox/0004-Avoid-redefined-warnings-when-buiding-with-utmps.patch
@@ -0,0 +1,108 @@
+From a7f1a174c2f5fd4ee7e130e08dfc79abc65e8a5e Mon Sep 17 00:00:00 2001
+From: Laurent Bercot <ska-devel@skarnet.org>
+Date: Fri, 22 Jul 2022 08:34:50 +0200
+Subject: [PATCH] Avoid redefined warnings when buiding with utmps
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Do not use _PATH_UTMP or _PATH_WTMP, and do not touch
+the files directly.
+
+---
+ include/libbb.h | 8 +++-----
+ libbb/messages.c | 4 ++--
+ libbb/utmp.c | 10 ++++++----
+ util-linux/last_fancy.c | 2 +-
+ 4 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/include/libbb.h b/include/libbb.h
+index cca33a177..2b72e7ac4 100644
+--- a/include/libbb.h
++++ b/include/libbb.h
+@@ -107,14 +107,12 @@
+ # define _PATH_UTMPX _PATH_UTMP
+ # else
+ # if !defined(__FreeBSD__)
+-# include <utmp.h>
++# include <utmpx.h>
++# define _CORRECT_PATH_UTMPX "/run/utmps/utmp"
++# define _CORRECT_PATH_WTMP "/var/log/wtmp"
+ # else
+ # define _PATH_UTMPX "/var/run/utx.active"
+ # endif
+-# include <utmpx.h>
+-# if defined _PATH_UTMP && !defined _PATH_UTMPX
+-# define _PATH_UTMPX _PATH_UTMP
+-# endif
+ # endif
+ #endif
+ #if ENABLE_LOCALE_SUPPORT
+diff --git a/libbb/messages.c b/libbb/messages.c
+index 6914d5701..689dd0c6d 100644
+--- a/libbb/messages.c
++++ b/libbb/messages.c
+@@ -42,8 +42,8 @@ const int const_int_0 = 0;
+ #if ENABLE_FEATURE_WTMP
+ /* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */
+ const char bb_path_wtmp_file[] ALIGN1 =
+-# if defined _PATH_WTMP
+- _PATH_WTMP;
++# if defined _CORRECT_PATH_WTMP
++ _CORRECT_PATH_WTMP;
+ # elif defined WTMP_FILE
+ WTMP_FILE;
+ # else
+diff --git a/libbb/utmp.c b/libbb/utmp.c
+index bd07670db..0a2ef2c8e 100644
+--- a/libbb/utmp.c
++++ b/libbb/utmp.c
+@@ -8,11 +8,13 @@
+ */
+ #include "libbb.h"
+
++#if 0
+ static void touch(const char *filename)
+ {
+ if (access(filename, R_OK | W_OK) == -1)
+ close(open(filename, O_WRONLY | O_CREAT, 0664));
+ }
++#endif
+
+ void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname)
+ {
+@@ -45,8 +47,8 @@ void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, con
+ tty_name += 3;
+ strncpy(id, tty_name, width);
+
+- touch(_PATH_UTMPX);
+- //utmpxname(_PATH_UTMPX);
++ //touch(_CORRECT_PATH_UTMPX);
++ //utmpxname(_CORRECT_PATH_UTMPX);
+ setutxent();
+ /* Append new one (hopefully, unless we collide on ut_id) */
+ pututxline(&utent);
+@@ -67,8 +69,8 @@ void FAST_FUNC update_utmp(pid_t pid, int new_type, const char *tty_name, const
+ struct utmpx utent;
+ struct utmpx *utp;
+
+- touch(_PATH_UTMPX);
+- //utmpxname(_PATH_UTMPX);
++ //touch(_CORRECT_PATH_UTMPX);
++ //utmpxname(_CORRECT_PATH_UTMPX);
+ setutxent();
+
+ /* Did init/getty/telnetd/sshd/... create an entry for us?
+diff --git a/util-linux/last_fancy.c b/util-linux/last_fancy.c
+index 648236229..aa7a62bbe 100644
+--- a/util-linux/last_fancy.c
++++ b/util-linux/last_fancy.c
+@@ -159,7 +159,7 @@ int last_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+ int last_main(int argc UNUSED_PARAM, char **argv)
+ {
+ struct utmpx ut;
+- const char *filename = _PATH_WTMP;
++ const char *filename = _CORRECT_PATH_WTMP;
+ llist_t *zlist;
+ off_t pos;
+ time_t start_time;