From d6beba26494f4877120c99b5931876f56ba5dee5 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Tue, 27 Nov 2018 18:18:58 +0200 Subject: 12127 auditd: cast between incompatible function types Reviewed by: C Fraire Approved by: Robert Mustacchi --- usr/src/cmd/auditd/auditd.c | 18 +++++++++--------- usr/src/cmd/auditd/doorway.c | 15 ++++++++------- 2 files changed, 17 insertions(+), 16 deletions(-) (limited to 'usr/src/cmd/auditd') diff --git a/usr/src/cmd/auditd/auditd.c b/usr/src/cmd/auditd/auditd.c index 14b1e12b28..16d4bfe572 100644 --- a/usr/src/cmd/auditd/auditd.c +++ b/usr/src/cmd/auditd/auditd.c @@ -115,7 +115,7 @@ static int reset_file = 1; /* 1 to close/open binary log */ static int auditing_set = 0; /* 1 if auditon(A_SETCOND, on... */ static void my_sleep(); -static void signal_thread(); +static void *signal_thread(void *); static void loadauditlist(); static void block_signals(); static int do_sethost(); @@ -262,8 +262,7 @@ main(int argc, char *argv[]) /* * Set up a separate thread for signal handling. */ - if (pthread_create(&tid, NULL, (void *(*)(void *))signal_thread, - NULL)) { + if (pthread_create(&tid, NULL, signal_thread, NULL)) { (void) fprintf(stderr, gettext( "auditd can't create a thread\n")); auditd_exit(1); @@ -725,8 +724,8 @@ block_signals() * The thread is created with all signals blocked. */ -static void -signal_thread() +static void * +signal_thread(void *arg __unused) { sigset_t set; int signal_caught; @@ -766,6 +765,7 @@ signal_thread() } (void) pthread_cond_signal(&(main_thr.thd_cv)); } + return (NULL); } /* @@ -819,11 +819,11 @@ fail: static void conf_to_kernel(void) { - register au_event_ent_t *evp; - register int i; + au_event_ent_t *evp; + int i; char *msg; - au_evclass_map_t ec; - au_stat_t as; + au_evclass_map_t ec; + au_stat_t as; if (auditon(A_GETSTAT, (caddr_t)&as, 0) != 0) { (void) asprintf(&msg, gettext("Audit module does not appear " diff --git a/usr/src/cmd/auditd/doorway.c b/usr/src/cmd/auditd/doorway.c index 325e3ee066..c3fe37afe6 100644 --- a/usr/src/cmd/auditd/doorway.c +++ b/usr/src/cmd/auditd/doorway.c @@ -102,7 +102,7 @@ static pthread_mutex_t b_alloc_lock; static pthread_mutex_t b_refcnt_lock; static void input(void *, void *, int, door_desc_t *, int); -static void process(plugin_t *); +static void *process(void *); static audit_q_t *qpool_withdraw(plugin_t *); static void qpool_init(plugin_t *, int); @@ -505,8 +505,7 @@ auditd_thread_init() (void) pthread_cond_init(&(p->plg_cv), NULL); p->plg_waiting = 0; - if (pthread_create(&(p->plg_tid), NULL, - (void *(*)(void *))process, p)) { + if (pthread_create(&(p->plg_tid), NULL, process, p)) { report_error(INTERNAL_SYS_ERROR, gettext("thread creation failed"), p->plg_path); @@ -787,7 +786,7 @@ bpool_return(audit_rec_t *node) #if DEBUG audit_rec_t *copy = node; #endif - node = audit_release(&b_refcnt_lock, node); /* decrement ref cnt */ + node = audit_release(&b_refcnt_lock, node); /* decrement ref cnt */ if (node != NULL) { /* NULL if ref cnt is not zero */ audit_enqueue(&b_pool, node); @@ -1179,15 +1178,16 @@ input_exit: /* * process() -- pass a buffer to a plugin */ -static void -process(plugin_t *p) +static void * +process(void *arg) { + plugin_t *p = arg; int rc; audit_rec_t *b_node; audit_q_t *q_node; auditd_rc_t plugrc; char *error_string; - struct timespec delay; + struct timespec delay; int sendsignal; int queue_len; struct sched_param param; @@ -1314,4 +1314,5 @@ plugin_removed: (void) pthread_mutex_lock(&plugin_mutex); (void) unload_plugin(p); (void) pthread_mutex_unlock(&plugin_mutex); + return (NULL); } -- cgit v1.2.3