Skip to content
Snippets Groups Projects
Commit b2e57ac5 authored by Nikita Pettik's avatar Nikita Pettik
Browse files

xlog: fix xdir_say_gc() usage in xdir_collect_garbage()

xdir_say_gc() takes errno and return code of unlink() sys call. If RC
is negative (meaning that unlink failed) we reset errno to given value
and log corresponding error message (it is done this way since eio saves
errno to internal structure so we have to restore it manually). Before
this patch, unlink() call was "in-place" of argument. However, the order
of argument evaluation is unspecified. So it may turn out that we assign
errno to the previous value, which is obviously wrong. To fix it let's
firstly invoke unlink() and then pass the result of call to
xdir_say_gc().
parent 5f0bbe12
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment