Date: Mon, 12 Apr 2010 08:58:21 GMT From: YAMAMOTO@FreeBSD.org, Shigeru <shigeru@iij.ad.jp> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/145643: [ports/japanese/mh] fix compile error which is caused by replacing 'utmp.h' to 'utmpx.h' Message-ID: <201004120858.o3C8wLct072303@www.freebsd.org> Resent-Message-ID: <201004120900.o3C905JQ029922@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 145643 >Category: ports >Synopsis: [ports/japanese/mh] fix compile error which is caused by replacing 'utmp.h' to 'utmpx.h' >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Apr 12 09:00:05 UTC 2010 >Closed-Date: >Last-Modified: >Originator: YAMAMOTO, Shigeru >Release: FreeBSD 9.0-CURRENT >Organization: Internet Initiative Japan Inc. >Environment: FreeBSD mercury.iij.ad.jp 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Mon Apr 12 08:53:14 JST 2010 root@mercury.iij.ad.jp:/usr/src/sys/amd64/compile/GENERIC amd64 >Description: ports/japanese/mh is now 'BROKEN', becase of 'fails to build with new utmpx'. I fix some codes to be able to compile ports/japanese/mh. But I don't test it. #only check compileing it. >How-To-Repeat: 1) cd /usr/ports/japanese/mh 2) make >Fix: Patch attached with submission follows: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # ./files/patch-uip:rcvtty.c # ./files/patch-uip:slocal.c # echo x - ./files/patch-uip:rcvtty.c sed 's/^X//' >./files/patch-uip:rcvtty.c << '818b4c79655ac1dad35c0f218f83e31b' X--- uip/rcvtty.c.orig 2001-04-05 01:05:17.000000000 +0900 X+++ uip/rcvtty.c 2010-04-12 17:36:19.000000000 +0900 X@@ -12,7 +12,11 @@ X #include "../zotnet/tws.h" X #include <signal.h> X #include <sys/stat.h> X+#include <sys/param.h> X #ifndef TTYD X+#if __FreeBSD_version > 900007 X+#include <utmpx.h> X+#else /* __FreeBSD_version > 900007 */ X #include <utmp.h> X #ifndef UTMP_FILENAME X #ifdef UTMP_FILE X@@ -25,6 +29,7 @@ X #endif X #endif X #endif /* UTMP_FILENAME */ X+#endif /* __FreeBSD_version > 900007 */ X #endif /* not TTYD */ X #ifdef LOCALE X #include <locale.h> X@@ -110,8 +115,12 @@ X *vec[MAXARGS]; X #ifndef TTYD X char tty[BUFSIZ]; X+#if __FreeBSD_version > 900007 X+ struct utmpx *ut; X+#else /* __FreeBSD_version > 900007 */ X struct utmp ut; X register FILE *uf; X+#endif /* __FreeBSD_version > 900007 */ X #endif /* not TTYD */ X X #ifdef BSD43 X@@ -200,6 +209,13 @@ X X user = getusr (); X #ifndef TTYD X+#if __FreeBSD_version > 900007 X+ ut = getutxuser(user); X+ if (ut != NULL) { X+ (void) strncpy (tty, ut->ut_line, sizeof ut->ut_line); X+ alert (tty, md); X+ } X+#else /* __FreeBSD_version > 900007 */ X if ((uf = fopen (UTMP_FILENAME, "r")) == NULL) X exit (RCV_MBX); X while (fread ((char *) &ut, sizeof ut, 1, uf) == 1) X@@ -212,6 +228,7 @@ X alert (tty, md); X } X (void) fclose (uf); X+#endif /* __FreeBSD_version > 900007 */ X #else /* TTYD */ X alert (user, md); X #endif /* TTYD */ 818b4c79655ac1dad35c0f218f83e31b echo x - ./files/patch-uip:slocal.c sed 's/^X//' >./files/patch-uip:slocal.c << 'bad534e727880848b3ceded2c8d3b1d5' X--- uip/slocal.c.orig 2000-12-04 21:09:38.000000000 +0900 X+++ uip/slocal.c 2010-04-12 17:10:12.000000000 +0900 X@@ -36,6 +36,10 @@ X #endif /* NOIOCTLH */ X #endif /* not V7 */ X #include <sys/stat.h> X+#include <sys/param.h> X+#if __FreeBSD_version > 900007 X+#include <utmpx.h> X+#else /* __FreeBSD_version > 900007 */ X #include <utmp.h> X #ifndef UTMP_FILENAME X #ifdef UTMP_FILE X@@ -48,6 +52,7 @@ X #endif X #endif X #endif /* UTMP_FILENAME */ X+#endif /* __FreeBSD_version > 900007 */ X #ifdef LOCALE X #include <locale.h> X #endif X@@ -938,6 +943,24 @@ X X /* */ X X+#if __FreeBSD_version > 900007 X+static int logged_in (void) { X+ if (utmped) { X+ return utmped; X+ } X+ else { X+ struct utmpx* ut = NULL; X+ X+ ut = getutxuser(user); X+ if (ut != NULL) { X+ return (utmped = DONE); X+ } X+ else { X+ return (utmped = NOTOK); X+ } X+ } X+} X+#else /* __FreeBSD_version > 900007 */ X static int logged_in () { X struct utmp ut; X register FILE *uf; X@@ -963,6 +986,7 @@ X (void) fclose (uf); X return (utmped = NOTOK); X } X+#endif /* __FreeBSD_version > 900007 */ X X X static int timely (t1, t2) bad534e727880848b3ceded2c8d3b1d5 exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004120858.o3C8wLct072303>