Skip to content

Commit

Permalink
plogv() has va_list as its parameter so that no need to call va_start…
Browse files Browse the repository at this point in the history
… in it.
  • Loading branch information
sakane committed May 7, 2002
1 parent 5f987e8 commit fd56a3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
12 changes: 3 additions & 9 deletions kame/kame/racoon/plog.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: plog.c,v 1.22 2002/04/26 00:00:10 itojun Exp $ */
/* $KAME: plog.c,v 1.23 2002/05/07 08:56:19 sakane Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -131,23 +131,18 @@ plog(int pri, const char *func, struct sockaddr *sa, const char *fmt, ...)

void
plogv(int pri, const char *func, struct sockaddr *sa,
const char *fmt, ...)
const char *fmt, va_list ap)
{
char *newfmt;
va_list ap;

if (pri > loglevel)
return;

newfmt = plog_common(pri, fmt, func);

if (f_foreground) {
va_start(ap, fmt);
if (f_foreground)
vprintf(newfmt, ap);
va_end(ap);
}

va_start(ap, fmt);
if (logfile)
log_vaprint(logp, newfmt, ap);
else {
Expand All @@ -156,7 +151,6 @@ plogv(int pri, const char *func, struct sockaddr *sa,
else
vsyslog(LOG_ALERT, newfmt, ap);
}
va_end(ap);
}

void
Expand Down
4 changes: 2 additions & 2 deletions kame/kame/racoon/plog.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: plog.h,v 1.9 2002/04/26 00:00:10 itojun Exp $ */
/* $KAME: plog.h,v 1.10 2002/05/07 08:56:19 sakane Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -62,7 +62,7 @@ extern int f_foreground;
struct sockaddr;
extern void plog __P((int, const char *, struct sockaddr *, const char *, ...));
extern void plogv __P((int, const char *, struct sockaddr *,
const char *, ...));
const char *, va_list));
extern void plogdump __P((int, void *, size_t));
extern void ploginit __P((void));
extern void plogset __P((char *));

0 comments on commit fd56a3c

Please sign in to comment.