hpc / mpifileutils

File utilities designed for scalability and performance.
https://hpc.github.io/mpifileutils
BSD 3-Clause "New" or "Revised" License
170 stars 68 forks source link

mfu_flist_walk.c: set WALK_RESULT = -1 #600

Closed ofaaland closed 1 week ago

ofaaland commented 1 week ago

Fixes issues identified in the code review of #599

Since WALK_RESULT is an int and can only hold one error code, but any number of errors might be encountered during a walk, there is little value in recording errno.

In addition, the value of errno might have changed unless it is captured immediately after the library or system call that failed, which would require deeper code changes.

Instead, set to -1 as the indicator of a failure.