diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-07-17 20:09:58 -0700 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2017-09-08 16:38:17 -0400 |
commit | e9b03cb0e0f36646c422d45779390530c8a42bbb (patch) | |
tree | 5e8aa58aac36c67706492f537bdbf124206cc5d8 /meta-networking/recipes-connectivity | |
parent | 7daa126fc2e034a6a826d43547100277c765cf9a (diff) | |
download | meta-openembedded-e9b03cb0e0f36646c422d45779390530c8a42bbb.tar.gz |
rdate: Define logwtmp if libc != glibc
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-connectivity')
-rw-r--r-- | meta-networking/recipes-connectivity/rdate/rdate/0001-rdate-define-logwtmp-on-libc-glibc.patch | 40 | ||||
-rw-r--r-- | meta-networking/recipes-connectivity/rdate/rdate_1.5.bb | 1 |
2 files changed, 41 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/rdate/rdate/0001-rdate-define-logwtmp-on-libc-glibc.patch b/meta-networking/recipes-connectivity/rdate/rdate/0001-rdate-define-logwtmp-on-libc-glibc.patch new file mode 100644 index 000000000..08ba2c31e --- /dev/null +++ b/meta-networking/recipes-connectivity/rdate/rdate/0001-rdate-define-logwtmp-on-libc-glibc.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From e0c690acfcddd3c3421f6eb0182c54815fd70f8f Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 14 Jul 2017 23:21:08 -0700 | ||
4 | Subject: [PATCH] rdate: define logwtmp on libc != glibc | ||
5 | |||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | --- | ||
8 | src/rdate.c | 15 +++++++++++++++ | ||
9 | 1 file changed, 15 insertions(+) | ||
10 | |||
11 | diff --git a/src/rdate.c b/src/rdate.c | ||
12 | index 943d481..685b1b8 100644 | ||
13 | --- a/src/rdate.c | ||
14 | +++ b/src/rdate.c | ||
15 | @@ -41,7 +41,22 @@ static int print_mode = 0; // display the time | ||
16 | static int timeout = 10; // timeout for each connection attempt | ||
17 | static char *service = DEFAULT_SERVICE; | ||
18 | |||
19 | +#ifndef __GLIBC__ | ||
20 | +static void logwtmp(const char * line, const char * name, const char * host) | ||
21 | +{ | ||
22 | + struct utmp u; | ||
23 | + memset(&u, 0, sizeof(u)); | ||
24 | + | ||
25 | + u.ut_pid = getpid(); | ||
26 | + u.ut_type = name[0] ? USER_PROCESS : DEAD_PROCESS; | ||
27 | + strncpy(u.ut_line, line, sizeof(u.ut_line)); | ||
28 | + strncpy(u.ut_name, name, sizeof(u.ut_name)); | ||
29 | + strncpy(u.ut_host, host, sizeof(u.ut_host)); | ||
30 | + gettimeofday(&(u.ut_tv), NULL); | ||
31 | |||
32 | + updwtmp(_PATH_WTMP, &u); | ||
33 | +} | ||
34 | +#endif /* __GLIBC__ */ | ||
35 | |||
36 | // Returns string from address info pointer | ||
37 | static char* | ||
38 | -- | ||
39 | 2.13.3 | ||
40 | |||
diff --git a/meta-networking/recipes-connectivity/rdate/rdate_1.5.bb b/meta-networking/recipes-connectivity/rdate/rdate_1.5.bb index b3af9275e..cd4db12c0 100644 --- a/meta-networking/recipes-connectivity/rdate/rdate_1.5.bb +++ b/meta-networking/recipes-connectivity/rdate/rdate_1.5.bb | |||
@@ -13,6 +13,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" | |||
13 | 13 | ||
14 | SRC_URI = "https://www.aelius.com/njh/${BPN}/${BP}.tar.gz \ | 14 | SRC_URI = "https://www.aelius.com/njh/${BPN}/${BP}.tar.gz \ |
15 | file://0001-src-rdate-Fix-printf-format-errors.patch \ | 15 | file://0001-src-rdate-Fix-printf-format-errors.patch \ |
16 | file://0001-rdate-define-logwtmp-on-libc-glibc.patch \ | ||
16 | " | 17 | " |
17 | SRC_URI[md5sum] = "0a4f612480777fdf25264ac03c57eae6" | 18 | SRC_URI[md5sum] = "0a4f612480777fdf25264ac03c57eae6" |
18 | SRC_URI[sha256sum] = "6e800053eaac2b21ff4486ec42f0aca7214941c7e5fceedd593fa0be99b9227d" | 19 | SRC_URI[sha256sum] = "6e800053eaac2b21ff4486ec42f0aca7214941c7e5fceedd593fa0be99b9227d" |