void-packages/srcpkgs/lightdm/patches/musl-updwtmpx.patch
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

38 lines
1.3 KiB
Diff

--- a/src/session-child.c
+++ b/src/session-child.c
@@ -194,7 +194,7 @@
/* GNU provides this but we can't rely on that so let's make our own version */
static void
-updwtmpx (const gchar *wtmp_file, struct utmpx *ut)
+_updwtmpx (const gchar *wtmp_file, struct utmpx *ut)
{
struct utmp u;
memset (&u, 0, sizeof (u));
@@ -363,7 +363,7 @@
ut.ut_tv.tv_sec = tv.tv_sec;
ut.ut_tv.tv_usec = tv.tv_usec;
- updwtmpx ("/var/log/btmp", &ut);
+ _updwtmpx ("/var/log/btmp", &ut);
#if HAVE_LIBAUDIT
audit_event (AUDIT_USER_LOGIN, username, -1, remote_host_name, tty, FALSE);
@@ -708,7 +708,7 @@
if (!pututxline (&ut))
g_printerr ("Failed to write utmpx: %s\n", strerror (errno));
endutxent ();
- updwtmpx ("/var/log/wtmp", &ut);
+ _updwtmpx ("/var/log/wtmp", &ut);
#if HAVE_LIBAUDIT
audit_event (AUDIT_USER_LOGIN, username, uid, remote_host_name, tty, TRUE);
@@ -749,7 +749,7 @@
if (!pututxline (&ut))
g_printerr ("Failed to write utmpx: %s\n", strerror (errno));
endutxent ();
- updwtmpx ("/var/log/wtmp", &ut);
+ _updwtmpx ("/var/log/wtmp", &ut);
#if HAVE_LIBAUDIT
audit_event (AUDIT_USER_LOGOUT, username, uid, remote_host_name, tty, TRUE);