Apply a new improved utmp patch.

Submitted by:	ed
This commit is contained in:
Cy Schubert 2010-07-22 03:22:48 +00:00
parent 8a087f5209
commit f86086845f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=258045
2 changed files with 6 additions and 35 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= screen
PORTVERSION= 4.0.3
PORTREVISION= 7
PORTREVISION= 8
CATEGORIES= sysutils
MASTER_SITES= ftp://ftp.uni-erlangen.de/pub/utilities/screen/ \
http://komquats.com/distfiles/ \

View File

@ -1,30 +1,6 @@
--- utmp.c.orig 2003-09-08 07:27:17.000000000 -0700
+++ utmp.c 2009-12-21 15:10:06.000000000 -0800
@@ -21,6 +21,9 @@
****************************************************************
*/
+#ifdef __FreeBSD__
+#include <sys/param.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -70,8 +73,13 @@
* (won't work for login-slots)
*/
#if (defined(sun) && defined(SVR4) && defined(GETUTENT)) || defined(HAVE_UTEMPTER)
+/* XXX FreeBSD-9 includes libutempter however if UTMP_HELPER is defined,
+ the build is broken due to utmpfd not being defined.
+*/
+#if defined(__FreeBSD_version) && (__FreeBSD_version < 900004 || __FreeBSD_version >= 900007) || !defined(__FreeBSD_version)
# define UTMP_HELPER
#endif
+#endif
@@ -589,7 +597,7 @@
--- utmp.c
+++ utmp.c
@@ -589,7 +589,7 @@
struct utmp *u;
{
u->ut_type = DEAD_PROCESS;
@ -33,17 +9,12 @@
u->ut_exit.e_termination = 0;
u->ut_exit.e_exit = 0;
#endif
@@ -726,9 +734,12 @@
char *line, *user;
int pid;
@@ -728,7 +728,7 @@
{
+ time_t temp;
+
strncpy(u->ut_line, line, sizeof(u->ut_line));
strncpy(u->ut_name, user, sizeof(u->ut_name));
- (void)time((time_t *)&u->ut_time);
+ (void)time(&temp);
+ u->ut_time = temp;
+ u->ut_time = time(NULL);
}
static slot_t