diff options
| -rw-r--r-- | meta-oe/recipes-support/libutempter/libutempter.bb | 4 | ||||
| -rw-r--r-- | meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch | 81 |
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 0282ba5005..8c84cb376f 100644 --- a/meta-oe/recipes-support/libutempter/libutempter.bb +++ b/meta-oe/recipes-support/libutempter/libutempter.bb | |||
| @@ -11,7 +11,9 @@ SRCREV = "3ef74fff310f09e2601e241b9f042cd39d591018" | |||
| 11 | PV = "1.1.6-alt2+git${SRCPV}" | 11 | PV = "1.1.6-alt2+git${SRCPV}" |
| 12 | 12 | ||
| 13 | SRC_URI = "git://git.altlinux.org/people/ldv/packages/libutempter.git \ | 13 | SRC_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 | ||
| 16 | S = "${WORKDIR}/git/${BPN}" | 18 | S = "${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 0000000000..6ed93355bb --- /dev/null +++ b/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | diff -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 | } | ||
