Date: Tue, 31 Jan 2006 01:26:30 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 90754 for review Message-ID: <200601310126.k0V1QUTE082270@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=90754 Change 90754 by rwatson@rwatson_peppercorn on 2006/01/31 01:25:44 A few missed instances that required style(9). Staticize one more function. This file is really long. Affected files ... .. //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#3 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#3 (text+ko) ==== @@ -53,15 +53,15 @@ #include <syslog.h> #include "auditd.h" -#define NA_EVENT_STR_SIZE 25 -static int ret, minval; -static char *lastfile = NULL; +#define NA_EVENT_STR_SIZE 25 -static int allhardcount = 0; -static int triggerfd = 0; +static int ret, minval; +static char *lastfile = NULL; +static int allhardcount = 0; +static int triggerfd = 0; -static TAILQ_HEAD(, dir_ent) dir_q; +static TAILQ_HEAD(, dir_ent) dir_q; /* * Error starting auditd @@ -297,7 +297,8 @@ /* * Close all log files, control files, and tell the audit system. */ -int close_all() +static int +close_all(void) { int err_ret = 0; char TS[POSTFIX_LEN]; @@ -305,31 +306,27 @@ token_t *tok; long cond; - /* Generate an audit record */ - if ((aufd = au_open()) == -1) { + /* Generate an audit record. */ + if ((aufd = au_open()) == -1) syslog(LOG_ERR, "Could not create audit shutdown event.\n"); - } else { - - if ((tok = au_to_text("auditd::Audit shutdown")) != NULL) { + else { + if ((tok = au_to_text("auditd::Audit shutdown")) != NULL) au_write(aufd, tok); - } - - if (au_close(aufd, 1, AUE_audit_shutdown) == -1) { - syslog(LOG_ERR, "Could not close audit shutdown event.\n"); - } + if (au_close(aufd, 1, AUE_audit_shutdown) == -1) + syslog(LOG_ERR, + "Could not close audit shutdown event.\n"); } - /* flush contents */ + /* Flush contents. */ cond = AUC_DISABLED; err_ret = auditon(A_SETCOND, &cond, sizeof(cond)); if (err_ret != 0) { syslog(LOG_ERR, "Disabling audit failed! : %s\n", - strerror(errno)); + strerror(errno)); err_ret = 1; } - if (getTSstr(TS, POSTFIX_LEN) == 0) { + if (getTSstr(TS, POSTFIX_LEN) == 0) close_lastfile(TS); - } if (lastfile != NULL) free(lastfile); @@ -341,9 +338,8 @@ } endac(); - if (close(triggerfd) != 0) { + if (close(triggerfd) != 0) syslog(LOG_ERR, "Error closing control file\n"); - } syslog(LOG_INFO, "Finished.\n"); return (0); } @@ -415,7 +411,7 @@ * enough to time to rotate log files without thrashing from soft warnings * generated before the log is actually rotated. */ -#define DUPLICATE_INTERVAL 30 +#define DUPLICATE_INTERVAL 30 static void handle_audit_trigger(int trigger) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601310126.k0V1QUTE082270>