Skip to content

Commit f236865

Browse files
authored
in_process_exporter_metrics: fix error logic when directory cannot be opened (#9549)
Signed-off-by: Lars-Dominik Braun <[email protected]>
1 parent dd6322c commit f236865

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/in_process_exporter_metrics/pe_process.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,10 @@ static int process_proc_fds(struct flb_pe *ctx, uint64_t ts,
759759

760760
snprintf(fd_procfs, sizeof(fd_procfs) - 1, "%s/%s", process->str, "fd");
761761
dir = opendir(fd_procfs);
762-
if (dir == NULL && errno == EACCES) {
763-
flb_plg_debug(ctx->ins, "NO read access for path: %s", fd_procfs);
762+
if (dir == NULL) {
763+
if (errno == EACCES) {
764+
flb_plg_debug(ctx->ins, "NO read access for path: %s", fd_procfs);
765+
}
764766
return -1;
765767
}
766768

0 commit comments

Comments
 (0)