Skip to content

Commit aadaf1c

Browse files
Leonardo Alminanaedsiper
authored andcommitted
in_blob: fixed already registered file log message
Signed-off-by: Leonardo Alminana <[email protected]>
1 parent 8f1fd00 commit aadaf1c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

plugins/in_blob/blob.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ static ssize_t recursive_file_search(struct blob_ctx *ctx,
561561
(uint64_t) fs_entry_metadata.st_ino);
562562
}
563563
else {
564+
/* Result codes :
565+
* 0 - Success
566+
* -1 - Generic failure
567+
* 1 - The file was alrady present in our records
568+
*/
564569
flb_plg_debug(ctx->ins,
565570
"blob scan skip: %s",
566571
glob_context.gl_pathv[index]);

plugins/in_blob/blob_file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ int blob_file_append(struct blob_ctx *ctx, char *path, struct stat *st)
4040
bfile = cfl_list_entry(head, struct blob_file, _head);
4141
if (strcmp(bfile->path, path) == 0) {
4242
/* file already exists */
43-
return -1;
43+
return 1;
4444
}
4545
}
4646

4747
#ifdef FLB_HAVE_SQLDB
4848
if (ctx->database_file) {
4949
/* the file was already registered, just skipt it */
5050
if (blob_db_file_exists(ctx, path, &id_found) == FLB_TRUE) {
51-
return 0;
51+
return 1;
5252
}
5353
}
5454
#endif

0 commit comments

Comments
 (0)