From 8ca02062561fae6bddf7499b1e6bb7196eaba647 Mon Sep 17 00:00:00 2001 From: Hakan Olsson Date: Sun, 22 May 2005 12:14:17 +0000 Subject: style nits --- usr.sbin/sasyncd/log.c | 9 +++++---- usr.sbin/sasyncd/net_ctl.c | 5 ++--- usr.sbin/sasyncd/sasyncd.c | 6 ++++-- usr.sbin/sasyncd/sasyncd.h | 3 +-- 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'usr.sbin/sasyncd') diff --git a/usr.sbin/sasyncd/log.c b/usr.sbin/sasyncd/log.c index d8163468c34..e7e7aa9fd4b 100644 --- a/usr.sbin/sasyncd/log.c +++ b/usr.sbin/sasyncd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.2 2005/03/30 18:56:19 ho Exp $ */ +/* $OpenBSD: log.c,v 1.3 2005/05/22 12:14:16 ho Exp $ */ /* * Copyright (c) 2005 Håkan Olsson. All rights reserved. @@ -62,8 +62,9 @@ log_output(char *msg) void log_err(const char *fmt, ...) { - va_list ap; - int off = 0; + extern char *__progname; + int off = 0; + va_list ap; if (cfgstate.debug) { snprintf(logbuf, sizeof logbuf, "%s: ", __progname); @@ -75,7 +76,7 @@ log_err(const char *fmt, ...) va_end(ap); strlcat(logbuf, ": ", sizeof logbuf); - strlcat(logbuf, strerror (errno), sizeof logbuf); + strlcat(logbuf, strerror(errno), sizeof logbuf); log_output(logbuf); return; diff --git a/usr.sbin/sasyncd/net_ctl.c b/usr.sbin/sasyncd/net_ctl.c index 97cabfa97f4..f58668363d3 100644 --- a/usr.sbin/sasyncd/net_ctl.c +++ b/usr.sbin/sasyncd/net_ctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: net_ctl.c,v 1.1 2005/03/30 18:44:49 ho Exp $ */ +/* $OpenBSD: net_ctl.c,v 1.2 2005/05/22 12:14:16 ho Exp $ */ /* * Copyright (c) 2005 Håkan Olsson. All rights reserved. @@ -62,8 +62,7 @@ net_ctl_check_state(struct syncpeer *p, enum RUNSTATE nstate) net_ctl_send_error(p, CTL_STATE); return -1; } - if (cfgstate.runstate == MASTER && - nstate == MASTER) { + if (cfgstate.runstate == MASTER && nstate == MASTER) { log_msg(0, "got bad state MASTER from peer \"%s\"", p->name); net_ctl_send_error(p, CTL_STATE); diff --git a/usr.sbin/sasyncd/sasyncd.c b/usr.sbin/sasyncd/sasyncd.c index c9dd08c2b9c..b859cb3ed69 100644 --- a/usr.sbin/sasyncd/sasyncd.c +++ b/usr.sbin/sasyncd/sasyncd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sasyncd.c,v 1.5 2005/05/03 05:44:35 djm Exp $ */ +/* $OpenBSD: sasyncd.c,v 1.6 2005/05/22 12:14:16 ho Exp $ */ /* * Copyright (c) 2005 Håkan Olsson. All rights reserved. @@ -47,6 +47,7 @@ static void privdrop(void) { struct passwd *pw = getpwnam(SASYNCD_USER); + extern char *__progname; if (!pw) { log_err("%s: getpwnam(\"%s\") failed", __progname, @@ -141,7 +142,8 @@ sasyncd_run(void) int main(int argc, char **argv) { - int r; + extern char *__progname; + int r; /* Init. */ closefrom(STDERR_FILENO + 1); diff --git a/usr.sbin/sasyncd/sasyncd.h b/usr.sbin/sasyncd/sasyncd.h index f1d6c8f3ef6..57648575482 100644 --- a/usr.sbin/sasyncd/sasyncd.h +++ b/usr.sbin/sasyncd/sasyncd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sasyncd.h,v 1.2 2005/04/03 17:19:26 ho Exp $ */ +/* $OpenBSD: sasyncd.h,v 1.3 2005/05/22 12:14:16 ho Exp $ */ /* * Copyright (c) 2005 Håkan Olsson. All rights reserved. @@ -62,7 +62,6 @@ struct cfgstate { }; extern struct cfgstate cfgstate; -extern char *__progname; #define SASYNCD_USER "_isakmpd" #define SASYNCD_CFGFILE "/etc/sasyncd.conf" -- cgit v1.2.3