svn commit: r200157 - head/bin/date

Vladimir Grebenschikov vova at fbsd.ru
Mon Dec 7 06:37:12 UTC 2009


Hi 

Looks like this change broke boot process, it shows following message on
early stage of boot:

/libexec/ld-elf.so.1: Shared object "libulog.so.0" not found, required by "date"

date is used while /usr is not mounted yet, but libulog.so located
in /use/lib:

$ ldd /bin/date
/bin/date:
        libulog.so.0 => /usr/lib/libulog.so.0 (0x48090000)
        libc.so.7 => /lib/libc.so.7 (0x48094000)
$



-----Original Message-----
From: Ed Schouten <ed at FreeBSD.org>
To: src-committers at freebsd.org, svn-src-all at freebsd.org,
svn-src-head at freebsd.org
Subject: svn commit: r200157 - head/bin/date
Date: Sat, 5 Dec 2009 20:09:50 +0000 (UTC)

Author: ed
Date: Sat Dec  5 20:09:50 2009
New Revision: 200157
URL: http://svn.freebsd.org/changeset/base/200157

Log:
  Let date(1) use utmpx instead of logwtmp().
  
  utmpx also has OLD_TIME/NEW_TIME messages, which seem to be intended for
  the same purpose as how we call logwtmp() here.

Modified:
  head/bin/date/Makefile
  head/bin/date/date.c

Modified: head/bin/date/Makefile
==============================================================================
--- head/bin/date/Makefile	Sat Dec  5 20:05:25 2009	(r200156)
+++ head/bin/date/Makefile	Sat Dec  5 20:09:50 2009	(r200157)
@@ -3,7 +3,7 @@
 
 PROG=	date
 SRCS=	date.c netdate.c vary.c
-DPADD=	${LIBUTIL}
-LDADD=	-lutil
+DPADD=	${LIBULOG}
+LDADD=	-lulog
 
 .include <bsd.prog.mk>

Modified: head/bin/date/date.c
==============================================================================
--- head/bin/date/date.c	Sat Dec  5 20:05:25 2009	(r200156)
+++ head/bin/date/date.c	Sat Dec  5 20:09:50 2009	(r200157)
@@ -48,11 +48,12 @@ __FBSDID("$FreeBSD$");
 #include <ctype.h>
 #include <err.h>
 #include <locale.h>
-#include <libutil.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <syslog.h>
+#define	_ULOG_POSIX_NAMES
+#include <ulog.h>
 #include <unistd.h>
 
 #include "extern.h"
@@ -181,6 +182,7 @@ main(int argc, char *argv[])
 static void
 setthetime(const char *fmt, const char *p, int jflag, int nflag)
 {
+	struct utmpx utx;
 	struct tm *lt;
 	struct timeval tv;
 	const char *dot, *t;
@@ -271,12 +273,16 @@ setthetime(const char *fmt, const char *
 	if (!jflag) {
 		/* set the time */
 		if (nflag || netsettime(tval)) {
-			logwtmp("|", "date", "");
+			utx.ut_type = OLD_TIME;
+			gettimeofday(&utx.ut_tv, NULL);
+			pututxline(&utx);
 			tv.tv_sec = tval;
 			tv.tv_usec = 0;
 			if (settimeofday(&tv, (struct timezone *)NULL))
 				err(1, "settimeofday (timeval)");
-			logwtmp("{", "date", "");
+			utx.ut_type = NEW_TIME;
+			gettimeofday(&utx.ut_tv, NULL);
+			pututxline(&utx);
 		}
 
 		if ((p = getlogin()) == NULL)
_______________________________________________
svn-src-all at freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe at freebsd.org"


-- 
Vladimir B. Grebenschikov
vova at fbsd.ru


More information about the svn-src-all mailing list