Skip to content

Commit

Permalink
flb_utils: suppress errno when file is empty but readable.
Browse files Browse the repository at this point in the history
# Summary

Suppress a false error log when flb_utils_read_file reads empty files.

Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan authored Aug 17, 2023
1 parent 8ae604e commit 36898d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/flb_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,9 @@ int flb_utils_read_file(char *path, char **out_buf, size_t *out_size)

bytes = fread(buf, st.st_size, 1, fp);
if (bytes < 1) {
flb_errno();
if (bytes < 0) {
flb_errno();
}
flb_free(buf);
fclose(fp);
return -1;
Expand Down

0 comments on commit 36898d0

Please sign in to comment.