Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tree: move assignments of ->tree_errno up a bit
Both tree_ascend() and tree_pop() may cause errno to be set/clobbered. As for the latter, we're certainly not interested in the random values that free() etc. may leave in errno. If tree_ascend() fails, its return value takes precedence in determining t->visit_type and the return value, but tree_ascend() also updates t->tree_errno appropriately, which makes sense. But when tree_ascend() succeeds, t->tree_errno should reflect the reason for opendir() failing, which requires that we record errno immediately. Bug bounty: $20
- Loading branch information