Port everything in bin/ from utmp to utmpx.
date: use libc utmpx routines instead of the ones provided by libulog. pax: don't depend on <utmp.h>
This commit is contained in:
parent
adc17f0a42
commit
759dba8c5a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=202193
@ -3,7 +3,5 @@
|
|||||||
|
|
||||||
PROG= date
|
PROG= date
|
||||||
SRCS= date.c netdate.c vary.c
|
SRCS= date.c netdate.c vary.c
|
||||||
DPADD= ${LIBULOG}
|
|
||||||
LDADD= -lulog
|
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -52,9 +52,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#define _ULOG_POSIX_NAMES
|
|
||||||
#include <ulog.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <utmpx.h>
|
||||||
|
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
#include "vary.h"
|
#include "vary.h"
|
||||||
|
@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <utmp.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -66,10 +65,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#define OLDFRMTM "%b %e %Y"
|
#define OLDFRMTM "%b %e %Y"
|
||||||
#define CURFRMTD "%e %b %H:%M"
|
#define CURFRMTD "%e %b %H:%M"
|
||||||
#define OLDFRMTD "%e %b %Y"
|
#define OLDFRMTD "%e %b %Y"
|
||||||
#ifndef UT_NAMESIZE
|
|
||||||
#define UT_NAMESIZE 8
|
|
||||||
#endif
|
|
||||||
#define UT_GRPSIZE 6
|
|
||||||
|
|
||||||
static int d_first = -1;
|
static int d_first = -1;
|
||||||
|
|
||||||
@ -116,9 +111,8 @@ ls_list(ARCHD *arcn, time_t now, FILE *fp)
|
|||||||
*/
|
*/
|
||||||
if (strftime(f_date,DATELEN,timefrmt,localtime(&(sbp->st_mtime))) == 0)
|
if (strftime(f_date,DATELEN,timefrmt,localtime(&(sbp->st_mtime))) == 0)
|
||||||
f_date[0] = '\0';
|
f_date[0] = '\0';
|
||||||
(void)fprintf(fp, "%s%2u %-*s %-*s ", f_mode, sbp->st_nlink,
|
(void)fprintf(fp, "%s%2u %-12s %-12s ", f_mode, sbp->st_nlink,
|
||||||
UT_NAMESIZE, name_uid(sbp->st_uid, 1), UT_GRPSIZE,
|
name_uid(sbp->st_uid, 1), name_gid(sbp->st_gid, 1));
|
||||||
name_gid(sbp->st_gid, 1));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* print device id's for devices, or sizes for other nodes
|
* print device id's for devices, or sizes for other nodes
|
||||||
|
Loading…
Reference in New Issue
Block a user