Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 636038 Details for
Bug 712824
sys-libs/libutempter-1.1.6-r2 : utempter.c: error: #error Unsupported platform
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Remove-GLIBC-Defines.patch
0001-Remove-__GLIBC__-define.patch (text/plain), 2.47 KB, created by
Max Tottenham
on 2020-05-04 18:37:16 UTC
(
hide
)
Description:
Remove-GLIBC-Defines.patch
Filename:
MIME Type:
Creator:
Max Tottenham
Created:
2020-05-04 18:37:16 UTC
Size:
2.47 KB
patch
obsolete
>From e19931268e6beb918a4b72645ed885ca9e420177 Mon Sep 17 00:00:00 2001 >From: Max Tottenham <max@tottenham.io> >Date: Mon, 4 May 2020 19:27:39 +0000 >Subject: [PATCH] Remove __GLIBC__ define > >--- > utempter.c | 58 +++++++++++++++++++++++------------------------------- > 1 file changed, 25 insertions(+), 33 deletions(-) > >diff --git a/utempter.c b/utempter.c >index b79af97..69c9f26 100644 >--- a/utempter.c >+++ b/utempter.c >@@ -32,15 +32,12 @@ > #include <pwd.h> > #include <sys/ioctl.h> > #include <sys/stat.h> >+#include <sys/time.h> > #include <utmp.h> > >-#ifdef __GLIBC__ >-# include <pty.h> >-#elif defined(__FreeBSD__) >-# include <libutil.h> >-#else >-# error Unsupported platform >-#endif /* __GLIBC__ || __FreeBSD__ */ >+#if defined(__FreeBSD__) >+#include <libutil.h> >+#endif > > #define DEV_PREFIX "/dev/" > #define DEV_PREFIX_LEN (sizeof(DEV_PREFIX)-1) >@@ -106,17 +103,13 @@ validate_device(const char *device) > > static int > write_uwtmp_record(const char *user, const char *term, const char *host, >-#ifdef __GLIBC__ > pid_t pid, >-#endif > int add) > { > struct utmp ut; > struct timeval tv; > >-#ifdef __GLIBC__ > size_t offset; >-#endif > > memset(&ut, 0, sizeof(ut)); > >@@ -128,8 +121,28 @@ write_uwtmp_record(const char *user, const char *term, const char *host, > if (host) > strncpy(ut.ut_host, host, sizeof(ut.ut_host)); > >-#ifdef __GLIBC__ > >+#if defined(__FreeBSD__) >+ ut.ut_time = tv.tv_sec; >+ // Silence unused variable warning for FreeBSD >+ (void)pid; >+ >+ if (add) >+ { >+ login(&ut); >+ } else >+ { >+ if (logout(term) != 1) >+ { >+#ifdef UTEMPTER_DEBUG >+ fprintf(stderr, "utempter: logout: %s\n", >+ strerror(errno)); >+#endif >+ exit(EXIT_FAILURE); >+ } >+ } >+ >+#else > offset = (strlen(term) <= sizeof(ut.ut_id)) ? 0 : > strlen(term) - sizeof(ut.ut_id); > strncpy(ut.ut_id, term + offset, sizeof(ut.ut_id)); >@@ -156,26 +169,7 @@ write_uwtmp_record(const char *user, const char *term, const char *host, > > (void) updwtmp(_PATH_WTMP, &ut); > >-#elif defined(__FreeBSD__) >- >- ut.ut_time = tv.tv_sec; >- >- if (add) >- { >- login(&ut); >- } else >- { >- if (logout(term) != 1) >- { >-#ifdef UTEMPTER_DEBUG >- fprintf(stderr, "utempter: logout: %s\n", >- strerror(errno)); > #endif >- exit(EXIT_FAILURE); >- } >- } >- >-#endif /* __GLIBC__ || __FreeBSD__ */ > > #ifdef UTEMPTER_DEBUG > fprintf(stderr, >@@ -255,8 +249,6 @@ main(int argc, const char *argv[]) > validate_device(device); > > return write_uwtmp_record(pw->pw_name, device + DEV_PREFIX_LEN, host, >-#ifdef __GLIBC__ > pid, >-#endif > add); > } >-- >2.26.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 712824
:
620214
|
620216
|
620218
|
620220
|
620222
|
620224
| 636038