summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ntpd/log.c4
-rw-r--r--usr.sbin/ntpd/ntpd.h3
-rw-r--r--usr.sbin/ntpd/parse.y12
-rw-r--r--usr.sbin/ripd/log.c4
-rw-r--r--usr.sbin/ripd/log.h3
-rw-r--r--usr.sbin/ripd/parse.y12
-rw-r--r--usr.sbin/ypldap/parse.y12
-rw-r--r--usr.sbin/ypldap/ypldap.h3
8 files changed, 26 insertions, 27 deletions
diff --git a/usr.sbin/ntpd/log.c b/usr.sbin/ntpd/log.c
index c297efe739d..0db0245c46e 100644
--- a/usr.sbin/ntpd/log.c
+++ b/usr.sbin/ntpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.8 2007/08/22 21:04:30 ckuethe Exp $ */
+/* $OpenBSD: log.c,v 1.9 2014/11/03 20:15:30 bluhm Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -29,8 +29,6 @@
int debug;
extern int debugsyslog;
-void logit(int, const char *, ...);
-
void
log_init(int n_debug)
{
diff --git a/usr.sbin/ntpd/ntpd.h b/usr.sbin/ntpd/ntpd.h
index f1c540b99d1..be15ea0e59a 100644
--- a/usr.sbin/ntpd/ntpd.h
+++ b/usr.sbin/ntpd/ntpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntpd.h,v 1.110 2014/10/25 03:23:49 lteo Exp $ */
+/* $OpenBSD: ntpd.h,v 1.111 2014/11/03 20:15:30 bluhm Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -271,6 +271,7 @@ enum ctl_actions {
/* prototypes */
/* log.c */
void log_init(int);
+void logit(int, const char *, ...);
void vlog(int, const char *, va_list);
void log_warn(const char *, ...);
void log_warnx(const char *, ...);
diff --git a/usr.sbin/ntpd/parse.y b/usr.sbin/ntpd/parse.y
index 90d4bed2cd5..67683a1c1e2 100644
--- a/usr.sbin/ntpd/parse.y
+++ b/usr.sbin/ntpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.52 2013/11/25 12:58:42 benno Exp $ */
+/* $OpenBSD: parse.y,v 1.53 2014/11/03 20:15:31 bluhm Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -339,15 +339,15 @@ int
yyerror(const char *fmt, ...)
{
va_list ap;
- char *nfmt;
+ char *msg;
file->errors++;
va_start(ap, fmt);
- if (asprintf(&nfmt, "%s:%d: %s", file->name, yylval.lineno, fmt) == -1)
- fatalx("yyerror asprintf");
- vlog(LOG_CRIT, nfmt, ap);
+ if (vasprintf(&msg, fmt, ap) == -1)
+ fatalx("yyerror vasprintf");
va_end(ap);
- free(nfmt);
+ logit(LOG_CRIT, "%s:%d: %s", file->name, yylval.lineno, msg);
+ free(msg);
return (0);
}
diff --git a/usr.sbin/ripd/log.c b/usr.sbin/ripd/log.c
index a0ae314d6f7..b7fd7fab2cb 100644
--- a/usr.sbin/ripd/log.c
+++ b/usr.sbin/ripd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.4 2011/08/20 19:02:28 sthen Exp $ */
+/* $OpenBSD: log.c,v 1.5 2014/11/03 20:15:31 bluhm Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -36,8 +36,6 @@ static const char * const procnames[] = {
int debug;
int verbose;
-void logit(int, const char *, ...);
-
void
log_init(int n_debug)
{
diff --git a/usr.sbin/ripd/log.h b/usr.sbin/ripd/log.h
index bc2eb87f447..d2961e252ac 100644
--- a/usr.sbin/ripd/log.h
+++ b/usr.sbin/ripd/log.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.h,v 1.2 2009/11/02 20:28:49 claudio Exp $ */
+/* $OpenBSD: log.h,v 1.3 2014/11/03 20:15:31 bluhm Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -23,6 +23,7 @@
void log_init(int);
void log_verbose(int);
+void logit(int, const char *, ...);
void vlog(int, const char *, va_list);
void log_warn(const char *, ...);
void log_warnx(const char *, ...);
diff --git a/usr.sbin/ripd/parse.y b/usr.sbin/ripd/parse.y
index 37fe27f93b8..107f06f5776 100644
--- a/usr.sbin/ripd/parse.y
+++ b/usr.sbin/ripd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.32 2014/11/03 03:42:12 doug Exp $ */
+/* $OpenBSD: parse.y,v 1.33 2014/11/03 20:15:31 bluhm Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -383,15 +383,15 @@ int
yyerror(const char *fmt, ...)
{
va_list ap;
- char *nfmt;
+ char *msg;
file->errors++;
va_start(ap, fmt);
- if (asprintf(&nfmt, "%s:%d: %s", file->name, yylval.lineno, fmt) == -1)
- fatalx("yyerror asprintf");
- vlog(LOG_CRIT, nfmt, ap);
+ if (vasprintf(&msg, fmt, ap) == -1)
+ fatalx("yyerror vasprintf");
va_end(ap);
- free(nfmt);
+ logit(LOG_CRIT, "%s:%d: %s", file->name, yylval.lineno, msg);
+ free(msg);
return (0);
}
diff --git a/usr.sbin/ypldap/parse.y b/usr.sbin/ypldap/parse.y
index be2ffcb3bc9..4409c18a724 100644
--- a/usr.sbin/ypldap/parse.y
+++ b/usr.sbin/ypldap/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.14 2014/01/22 00:21:17 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.15 2014/11/03 20:15:31 bluhm Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -332,15 +332,15 @@ int
yyerror(const char *fmt, ...)
{
va_list ap;
- char *nfmt;
+ char *msg;
file->errors++;
va_start(ap, fmt);
- if (asprintf(&nfmt, "%s:%d: %s", file->name, yylval.lineno, fmt) == -1)
- fatalx("yyerror asprintf");
- vlog(LOG_CRIT, nfmt, ap);
+ if (vasprintf(&msg, fmt, ap) == -1)
+ fatalx("yyerror vasprintf");
va_end(ap);
- free(nfmt);
+ logit(LOG_CRIT, "%s:%d: %s", file->name, yylval.lineno, msg);
+ free(msg);
return (0);
}
diff --git a/usr.sbin/ypldap/ypldap.h b/usr.sbin/ypldap/ypldap.h
index b8f65ac7bfd..3a1bd17a776 100644
--- a/usr.sbin/ypldap/ypldap.h
+++ b/usr.sbin/ypldap/ypldap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypldap.h,v 1.14 2013/03/06 21:42:40 sthen Exp $ */
+/* $OpenBSD: ypldap.h,v 1.15 2014/11/03 20:15:31 bluhm Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -184,6 +184,7 @@ void log_warn(const char *, ...);
void log_warnx(const char *, ...);
void log_info(const char *, ...);
void log_debug(const char *, ...);
+void logit(int, const char *, ...);
void vlog(int, const char *, va_list);
__dead void fatal(const char *);
__dead void fatalx(const char *);