From: Jason Ish Date: Mon, 11 Mar 2024 23:06:50 +0000 (-0600) Subject: eve/filetype: ThreadDeinit can return void X-Git-Tag: suricata-8.0.0-beta1~1635 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eee9757dba4d7b1734ee861d5035778275b1d64e;p=thirdparty%2Fsuricata.git eve/filetype: ThreadDeinit can return void Change ThreadDeinit to return void instead of an int, there is nothing to be done on success or failure. --- diff --git a/examples/plugins/c-json-filetype/filetype.c b/examples/plugins/c-json-filetype/filetype.c index 9b7d86e80b..e20697bcb4 100644 --- a/examples/plugins/c-json-filetype/filetype.c +++ b/examples/plugins/c-json-filetype/filetype.c @@ -23,9 +23,6 @@ #define FILETYPE_NAME "json-filetype-plugin" -static int FiletypeThreadInit(void *ctx, ThreadId thread_id, void **thread_data); -static int FiletypeThreadDeinit(void *ctx, void *thread_data); - /** * Per thread context data for each logging thread. */ @@ -149,19 +146,18 @@ static int FiletypeThreadInit(void *ctx, ThreadId thread_id, void **thread_data) * This is where any cleanup per thread should be done including free'ing of the * thread_data if needed. */ -static int FiletypeThreadDeinit(void *ctx, void *thread_data) +static void FiletypeThreadDeinit(void *ctx, void *thread_data) { SCLogNotice("thread_data=%p", thread_data); if (thread_data == NULL) { // Nothing to do. - return 0; + return; } ThreadData *tdata = thread_data; SCLogNotice( "Deinitializing thread %d: records written: %" PRIu64, tdata->thread_id, tdata->count); SCFree(tdata); - return 0; } /** diff --git a/src/output-eve-null.c b/src/output-eve-null.c index afe11afc06..59e8c452fb 100644 --- a/src/output-eve-null.c +++ b/src/output-eve-null.c @@ -54,9 +54,8 @@ static int NullLogThreadInit(void *init_data, ThreadId thread_id, void **thread_ return 0; } -static int NullLogThreadDeInit(void *init_data, void *thread_data) +static void NullLogThreadDeInit(void *init_data, void *thread_data) { - return 0; } static void NullLogDeInit(void *init_data) diff --git a/src/output-eve.h b/src/output-eve.h index 385ecbf458..6ee0228a07 100644 --- a/src/output-eve.h +++ b/src/output-eve.h @@ -161,10 +161,8 @@ typedef struct SCEveFileType_ { * \param init_data The data setup in Init * * \param thread_data The data setup in ThreadInit - * - * \retval 0 on success, -1 on failure */ - int (*ThreadDeinit)(void *init_data, void *thread_data); + void (*ThreadDeinit)(void *init_data, void *thread_data); /* Internal list management. */ TAILQ_ENTRY(SCEveFileType_) entries;