put utilities into a separate file.

This commit is contained in:
christos 2015-01-21 19:23:42 +00:00
parent 9e607ccb2a
commit 6ea0b5bdc4
2 changed files with 7 additions and 15 deletions

View File

@ -1,12 +1,14 @@
# $NetBSD: Makefile,v 1.5 2015/01/21 16:16:00 christos Exp $
# $NetBSD: Makefile,v 1.6 2015/01/21 19:23:42 christos Exp $
BINDIR=/usr/sbin
PROGS=blacklistd blacklistctl
MAN=blacklistd.8
MAN.blacklistd=blacklistd.8
MAN.blacklistctl=blacklistctl.1
MLINKS=blacklistd.8 blacklistd.conf.5
SRCS.blacklistd = blacklistd.c conf.c run.c state.c
SRCS.blacklistctl = blacklistctl.c conf.c state.c
SRCS.blacklistd = blacklistd.c conf.c run.c state.c util.c
SRCS.blacklistctl = blacklistctl.c conf.c state.c util.c
DBG=-g
LDADD+=-lutil
DPADD+=${LIBUTIL}

View File

@ -12,17 +12,7 @@
#include "conf.h"
#include "state.h"
#include "internal.h"
static const char *
fmttime(char *b, size_t l, time_t t)
{
struct tm tm;
if (localtime_r(&t, &tm) == NULL)
snprintf(b, l, "*%jd*", (intmax_t)t);
else
strftime(b, l, "%Y/%m/%d %H:%M:%S", &tm);
return b;
}
#include "util.h"
int
main(int argc, char *argv[])