Skip to content

Commit

Permalink
in_process_exporter_metrics: fix error logic when directory cannot be…
Browse files Browse the repository at this point in the history
… opened (#9549)

Signed-off-by: Lars-Dominik Braun <[email protected]>
  • Loading branch information
PromyLOPh authored Dec 5, 2024
1 parent dd6322c commit f236865
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/in_process_exporter_metrics/pe_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,10 @@ static int process_proc_fds(struct flb_pe *ctx, uint64_t ts,

snprintf(fd_procfs, sizeof(fd_procfs) - 1, "%s/%s", process->str, "fd");
dir = opendir(fd_procfs);
if (dir == NULL && errno == EACCES) {
flb_plg_debug(ctx->ins, "NO read access for path: %s", fd_procfs);
if (dir == NULL) {
if (errno == EACCES) {
flb_plg_debug(ctx->ins, "NO read access for path: %s", fd_procfs);
}
return -1;
}

Expand Down

0 comments on commit f236865

Please sign in to comment.