]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve/filetype: ThreadDeinit can return void
authorJason Ish <jason.ish@oisf.net>
Mon, 11 Mar 2024 23:06:50 +0000 (17:06 -0600)
committerVictor Julien <victor@inliniac.net>
Sat, 16 Mar 2024 08:29:34 +0000 (09:29 +0100)
Change ThreadDeinit to return void instead of an int, there is nothing
to be done on success or failure.

examples/plugins/c-json-filetype/filetype.c
src/output-eve-null.c
src/output-eve.h

index 9b7d86e80b6d3b709116468a183db987734ec828..e20697bcb4c13b72e7dc2eb8ebeed668dcf71f13 100644 (file)
@@ -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;
 }
 
 /**
index afe11afc068fcacbd21847fccb6fb2fcdfd7696d..59e8c452fbec38c6abce7c0b56e1ec76dc806c38 100644 (file)
@@ -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)
index 385ecbf4581669a3040bb1df2ac16513cd60d0a2..6ee0228a07ea0462f47a8ee99cab6f4ff9f6f9ab 100644 (file)
@@ -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;