1 |
commit: a28bbe7cb1a166b1b71c20e3a4d2734e0593de76 |
2 |
Author: Jory Pratt <anarchy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 18 19:12:21 2019 +0000 |
4 |
Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 18 19:14:04 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a28bbe7c |
7 |
|
8 |
sys-auth/elogind: fix musl unable to write to cgroup |
9 |
|
10 |
Package-Manager: Portage-2.3.63, Repoman-2.3.12 |
11 |
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org> |
12 |
|
13 |
sys-auth/elogind/elogind-241.2.ebuild | 1 + |
14 |
.../elogind/files/elogind-241.2-unbreak-musl.patch | 41 ++++++++++++++++++++++ |
15 |
2 files changed, 42 insertions(+) |
16 |
|
17 |
diff --git a/sys-auth/elogind/elogind-241.2.ebuild b/sys-auth/elogind/elogind-241.2.ebuild |
18 |
index 37406f56c43..2b18cff05a4 100644 |
19 |
--- a/sys-auth/elogind/elogind-241.2.ebuild |
20 |
+++ b/sys-auth/elogind/elogind-241.2.ebuild |
21 |
@@ -42,6 +42,7 @@ PDEPEND=" |
22 |
DOCS=( src/libelogind/sd-bus/GVARIANT-SERIALIZATION ) |
23 |
|
24 |
PATCHES=( |
25 |
+ "${FILESDIR}/${PN}-241.2-unbreak-musl.patch" |
26 |
"${FILESDIR}/${PN}-241.1-docs.patch" |
27 |
) |
28 |
|
29 |
|
30 |
diff --git a/sys-auth/elogind/files/elogind-241.2-unbreak-musl.patch b/sys-auth/elogind/files/elogind-241.2-unbreak-musl.patch |
31 |
new file mode 100644 |
32 |
index 00000000000..3688402d2e0 |
33 |
--- /dev/null |
34 |
+++ b/sys-auth/elogind/files/elogind-241.2-unbreak-musl.patch |
35 |
@@ -0,0 +1,41 @@ |
36 |
+From cac266581e2bc3595be60171910db6274c3bf944 Mon Sep 17 00:00:00 2001 |
37 |
+From: Sven Eden <sven.eden@×××××××××.com> |
38 |
+Date: Thu, 18 Apr 2019 19:25:55 +0200 |
39 |
+Subject: [PATCH] src/basic/filio.c: Do not disable file buffers on non-glibc |
40 |
+ [#130] |
41 |
+ |
42 |
+When opening an existing file with open() and then turning is into |
43 |
+a FILE* with fdopen(), a following fputs() returns EOF and sets errno |
44 |
+to EINVAL on musl-libc based systems when setvbuf() was used to turn |
45 |
+off the file buffer. |
46 |
+ |
47 |
+To remedy this return to the old behavior until v239 and never |
48 |
+diesable the file buffer in such cases when not on a glibc based |
49 |
+system. |
50 |
+ |
51 |
+Bug: #130 |
52 |
+Closes: #130 |
53 |
+Signed-off-by: Sven Eden <sven.eden@×××××××××.com> |
54 |
+--- |
55 |
+ src/basic/fileio.c | 5 +++++ |
56 |
+ 1 file changed, 5 insertions(+) |
57 |
+ |
58 |
+diff --git a/src/basic/fileio.c b/src/basic/fileio.c |
59 |
+index e981cd024..eaad5ccf0 100644 |
60 |
+--- a/src/basic/fileio.c |
61 |
++++ b/src/basic/fileio.c |
62 |
+@@ -162,6 +162,11 @@ int write_string_file_ts( |
63 |
+ safe_close(fd); |
64 |
+ goto fail; |
65 |
+ } |
66 |
++ |
67 |
++#ifndef __GLIBC__ /// elogind must not disable buffers on musl-libc based systems when going this route |
68 |
++ if (flags & WRITE_STRING_FILE_DISABLE_BUFFER) |
69 |
++ flags ^= WRITE_STRING_FILE_DISABLE_BUFFER; |
70 |
++#endif // __GLIBC__ |
71 |
+ } |
72 |
+ |
73 |
+ (void) __fsetlocking(f, FSETLOCKING_BYCALLER); |
74 |
+-- |
75 |
+2.21.0 |
76 |
+ |