diff options
author | Motoyuki Konno <motoyuki@FreeBSD.org> | 2010-06-23 14:55:04 +0000 |
---|---|---|
committer | Motoyuki Konno <motoyuki@FreeBSD.org> | 2010-06-23 14:55:04 +0000 |
commit | b59efb942d34f0d78a39ab5dd0092213ae30be9f (patch) | |
tree | e3bc3e3dc49413431ec5382a86ccc5d2c042b068 /japanese | |
parent | 62bc7e149e895cc3d47447c4a935ed17404e7c8c (diff) | |
download | ports-b59efb942d34f0d78a39ab5dd0092213ae30be9f.tar.gz ports-b59efb942d34f0d78a39ab5dd0092213ae30be9f.zip |
Fix BROKEN in 9.0-current with new utmpx.
PR: ports/145643
Submitted by: YAMAMOTO, Shigeru <shigeru@iij.ad.jp>
Feature safe: yes
Notes
Notes:
svn path=/head/; revision=256865
Diffstat (limited to 'japanese')
-rw-r--r-- | japanese/mh/Makefile | 4 | ||||
-rw-r--r-- | japanese/mh/files/patch-uip:rcvtty.c | 57 | ||||
-rw-r--r-- | japanese/mh/files/patch-uip:slocal.c | 54 |
3 files changed, 111 insertions, 4 deletions
diff --git a/japanese/mh/Makefile b/japanese/mh/Makefile index 34be1ceb60c6..72ad2ac23f16 100644 --- a/japanese/mh/Makefile +++ b/japanese/mh/Makefile @@ -48,10 +48,6 @@ CONFLICTS= nmh-[0-9]* .include <bsd.port.pre.mk> -.if ${OSVERSION} > 900007 -BROKEN= fails to build with new utmpx -.endif - .if !defined(NOPORTDOCS) pre-install: ${MKDIR} ${PREFIX}/share/doc/ja-mh diff --git a/japanese/mh/files/patch-uip:rcvtty.c b/japanese/mh/files/patch-uip:rcvtty.c new file mode 100644 index 000000000000..71fc771d2a97 --- /dev/null +++ b/japanese/mh/files/patch-uip:rcvtty.c @@ -0,0 +1,57 @@ +--- uip/rcvtty.c.orig 2001-04-05 01:05:17.000000000 +0900 ++++ uip/rcvtty.c 2010-04-12 17:36:19.000000000 +0900 +@@ -12,7 +12,11 @@ + #include "../zotnet/tws.h" + #include <signal.h> + #include <sys/stat.h> ++#include <sys/param.h> + #ifndef TTYD ++#if __FreeBSD_version > 900007 ++#include <utmpx.h> ++#else /* __FreeBSD_version > 900007 */ + #include <utmp.h> + #ifndef UTMP_FILENAME + #ifdef UTMP_FILE +@@ -25,6 +29,7 @@ + #endif + #endif + #endif /* UTMP_FILENAME */ ++#endif /* __FreeBSD_version > 900007 */ + #endif /* not TTYD */ + #ifdef LOCALE + #include <locale.h> +@@ -110,8 +115,12 @@ + *vec[MAXARGS]; + #ifndef TTYD + char tty[BUFSIZ]; ++#if __FreeBSD_version > 900007 ++ struct utmpx *ut; ++#else /* __FreeBSD_version > 900007 */ + struct utmp ut; + register FILE *uf; ++#endif /* __FreeBSD_version > 900007 */ + #endif /* not TTYD */ + + #ifdef BSD43 +@@ -200,6 +209,13 @@ + + user = getusr (); + #ifndef TTYD ++#if __FreeBSD_version > 900007 ++ ut = getutxuser(user); ++ if (ut != NULL) { ++ (void) strncpy (tty, ut->ut_line, sizeof ut->ut_line); ++ alert (tty, md); ++ } ++#else /* __FreeBSD_version > 900007 */ + if ((uf = fopen (UTMP_FILENAME, "r")) == NULL) + exit (RCV_MBX); + while (fread ((char *) &ut, sizeof ut, 1, uf) == 1) +@@ -212,6 +228,7 @@ + alert (tty, md); + } + (void) fclose (uf); ++#endif /* __FreeBSD_version > 900007 */ + #else /* TTYD */ + alert (user, md); + #endif /* TTYD */ diff --git a/japanese/mh/files/patch-uip:slocal.c b/japanese/mh/files/patch-uip:slocal.c new file mode 100644 index 000000000000..c3be6fad957c --- /dev/null +++ b/japanese/mh/files/patch-uip:slocal.c @@ -0,0 +1,54 @@ +--- uip/slocal.c.orig 2000-12-04 21:09:38.000000000 +0900 ++++ uip/slocal.c 2010-04-12 17:10:12.000000000 +0900 +@@ -36,6 +36,10 @@ + #endif /* NOIOCTLH */ + #endif /* not V7 */ + #include <sys/stat.h> ++#include <sys/param.h> ++#if __FreeBSD_version > 900007 ++#include <utmpx.h> ++#else /* __FreeBSD_version > 900007 */ + #include <utmp.h> + #ifndef UTMP_FILENAME + #ifdef UTMP_FILE +@@ -48,6 +52,7 @@ + #endif + #endif + #endif /* UTMP_FILENAME */ ++#endif /* __FreeBSD_version > 900007 */ + #ifdef LOCALE + #include <locale.h> + #endif +@@ -938,6 +943,24 @@ + + /* */ + ++#if __FreeBSD_version > 900007 ++static int logged_in (void) { ++ if (utmped) { ++ return utmped; ++ } ++ else { ++ struct utmpx* ut = NULL; ++ ++ ut = getutxuser(user); ++ if (ut != NULL) { ++ return (utmped = DONE); ++ } ++ else { ++ return (utmped = NOTOK); ++ } ++ } ++} ++#else /* __FreeBSD_version > 900007 */ + static int logged_in () { + struct utmp ut; + register FILE *uf; +@@ -963,6 +986,7 @@ + (void) fclose (uf); + return (utmped = NOTOK); + } ++#endif /* __FreeBSD_version > 900007 */ + + + static int timely (t1, t2) |