diff -ur screen-4.0.2/os.h screen-4.0.2-leopard/os.h --- screen-4.0.2/os.h 2002-01-08 07:42:33.000000000 -0800 +++ screen-4.0.2-leopard/os.h 2007-11-05 14:33:14.000000000 -0800 @@ -260,7 +260,7 @@ #endif #if defined(UTMPOK) || defined(BUGGYGETLOGIN) -# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux) +# if (defined(SVR4) || defined(__APPLE__)) && !defined(DGUX) && !defined(__hpux) && !defined(linux) # include # define UTMPFILE UTMPX_FILE # define utmp utmpx diff -ur screen-4.0.2/pty.c screen-4.0.2-leopard/pty.c --- screen-4.0.2/pty.c 2003-09-08 07:26:18.000000000 -0700 +++ screen-4.0.2-leopard/pty.c 2007-11-05 14:46:36.000000000 -0800 @@ -34,7 +34,7 @@ #endif /* for solaris 2.1, Unixware (SVR4.2) and possibly others */ -#ifdef HAVE_SVR4_PTYS +#if defined(HAVE_SVR4_PTYS) && !defined(__APPLE__) # include #endif diff -ur screen-4.0.2/utmp.c screen-4.0.2-leopard/utmp.c --- screen-4.0.2/utmp.c 2003-09-08 07:27:17.000000000 -0700 +++ screen-4.0.2-leopard/utmp.c 2007-11-05 14:33:16.000000000 -0800 @@ -83,12 +83,18 @@ static void makedead __P((struct utmp *)); static int pututslot __P((slot_t, struct utmp *, char *, struct win *)); static struct utmp *getutslot __P((slot_t)); -#ifndef GETUTENT +#if !defined(GETUTENT) && !defined(__APPLE__) static struct utmp *getutent __P((void)); static void endutent __P((void)); static int initutmp __P((void)); static void setutent __P((void)); #endif +#ifdef __APPLE__ +struct utmp *getutent __P((void)); +void endutent __P((void)); +static int initutmp __P((void)); +void setutent __P((void)); +#endif #if defined(linux) && defined(GETUTENT) static struct utmp *xpututline __P((struct utmp *utmp)); # define pututline xpututline @@ -618,7 +624,11 @@ #endif /* sgi */ strncpy(u->ut_line, line, sizeof(u->ut_line)); u->ut_pid = pid; +#ifdef __APPLE__ + (void)time((time_t *)&u->ut_tv); +#else (void)time((time_t *)&u->ut_time); +#endif } static slot_t @@ -648,14 +658,22 @@ return (utmpfd = open(UtmpName, O_RDWR)) >= 0; } +#ifdef __APPLE__ +void +#else static void +#endif setutent() { if (utmpfd >= 0) (void)lseek(utmpfd, (off_t)0, 0); } +#ifdef __APPLE__ +void +#else static void +#endif endutent() { if (utmpfd >= 0) @@ -663,7 +681,11 @@ utmpfd = -1; } +#ifdef __APPLE__ +struct utmp * +#else static struct utmp * +#endif getutent() { if (utmpfd < 0 && !initutmp()) @@ -710,7 +732,11 @@ struct utmp *u; { #ifdef UT_UNSORTED +#ifdef __APPLE__ + bzero(u->ut_user, sizeof(u->ut_user)); +#else bzero(u->ut_name, sizeof(u->ut_name)); +#endif # ifdef UTHOST bzero(u->ut_host, sizeof(u->ut_host)); # endif @@ -727,8 +753,13 @@ int pid; { strncpy(u->ut_line, line, sizeof(u->ut_line)); +#ifdef __APPLE__ + strncpy(u->ut_user, user, sizeof(u->ut_user)); + (void)time((time_t *)&u->ut_tv); +#else strncpy(u->ut_name, user, sizeof(u->ut_name)); (void)time((time_t *)&u->ut_time); +#endif } static slot_t