summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-04-06 21:45:55 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-04-24 11:00:53 +0200
commit82c654d4c5bd383caa6e6ebaa85b96af4fd641cf (patch)
tree9ac2df006a3f099a95683b5c9bd41ff2cc081191 /meta-oe
parent95e511248174715a14a9542324fee2a8835ea2f8 (diff)
downloadmeta-openembedded-82c654d4c5bd383caa6e6ebaa85b96af4fd641cf.tar.gz
libutempter: Fix build with musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-support/libutempter/libutempter.bb4
-rw-r--r--meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch81
2 files changed, 84 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/libutempter/libutempter.bb b/meta-oe/recipes-support/libutempter/libutempter.bb
index 0282ba500..8c84cb376 100644
--- a/meta-oe/recipes-support/libutempter/libutempter.bb
+++ b/meta-oe/recipes-support/libutempter/libutempter.bb
@@ -11,7 +11,9 @@ SRCREV = "3ef74fff310f09e2601e241b9f042cd39d591018"
11PV = "1.1.6-alt2+git${SRCPV}" 11PV = "1.1.6-alt2+git${SRCPV}"
12 12
13SRC_URI = "git://git.altlinux.org/people/ldv/packages/libutempter.git \ 13SRC_URI = "git://git.altlinux.org/people/ldv/packages/libutempter.git \
14 file://0001-Fix-macro-error.patch" 14 file://0001-Fix-macro-error.patch \
15 file://libutempter-remove-glibc-assumption.patch \
16 "
15 17
16S = "${WORKDIR}/git/${BPN}" 18S = "${WORKDIR}/git/${BPN}"
17 19
diff --git a/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch b/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch
new file mode 100644
index 000000000..6ed93355b
--- /dev/null
+++ b/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch
@@ -0,0 +1,81 @@
1diff -Naur libutempter-1.1.6.orig/utempter.c libutempter-1.1.6/utempter.c
2--- libutempter-1.1.6.orig/utempter.c 2010-11-04 13:14:53.000000000 -0400
3+++ libutempter-1.1.6/utempter.c 2014-06-20 16:37:09.762403323 -0400
4@@ -34,13 +34,7 @@
5 #include <sys/stat.h>
6 #include <utmp.h>
7
8-#ifdef __GLIBC__
9 # include <pty.h>
10-#elif defined(__FreeBSD__)
11-# include <libutil.h>
12-#else
13-# error Unsupported platform
14-#endif /* __GLIBC__ || __FreeBSD__ */
15
16 #define DEV_PREFIX "/dev/"
17 #define DEV_PREFIX_LEN (sizeof(DEV_PREFIX)-1)
18@@ -106,17 +100,12 @@
19
20 static int
21 write_uwtmp_record(const char *user, const char *term, const char *host,
22-#ifdef __GLIBC__
23 pid_t pid,
24-#endif
25 int add)
26 {
27 struct utmp ut;
28 struct timeval tv;
29-
30-#ifdef __GLIBC__
31 size_t offset;
32-#endif
33
34 memset(&ut, 0, sizeof(ut));
35
36@@ -128,8 +117,6 @@
37 if (host)
38 strncpy(ut.ut_host, host, sizeof(ut.ut_host));
39
40-#ifdef __GLIBC__
41-
42 offset = (strlen(term) <= sizeof(ut.ut_id)) ? 0 :
43 strlen(term) - sizeof(ut.ut_id);
44 strncpy(ut.ut_id, term + offset, sizeof(ut.ut_id));
45@@ -156,27 +143,6 @@
46
47 (void) updwtmp(_PATH_WTMP, &ut);
48
49-#elif defined(__FreeBSD__)
50-
51- ut.ut_time = tv.tv_sec;
52-
53- if (add)
54- {
55- login(&ut);
56- } else
57- {
58- if (logout(term) != 1)
59- {
60-#ifdef UTEMPTER_DEBUG
61- fprintf(stderr, "utempter: logout: %s\n",
62- strerror(errno));
63-#endif
64- exit(EXIT_FAILURE);
65- }
66- }
67-
68-#endif /* __GLIBC__ || __FreeBSD__ */
69-
70 #ifdef UTEMPTER_DEBUG
71 fprintf(stderr,
72 "utempter: DEBUG: utmp/wtmp record %s for terminal '%s'\n",
73@@ -255,8 +221,6 @@
74 validate_device(device);
75
76 return write_uwtmp_record(pw->pw_name, device + DEV_PREFIX_LEN, host,
77-#ifdef __GLIBC__
78 pid,
79-#endif
80 add);
81 }