Merges: https://pagure.io/libuser/issue/26
The code used to first close(fd) and only then check if it's != -1. Reverse the logic so that the fd is only closed if valid.
rebased onto e5536845298b6672a16e5866a823fcf6562c6cf3
Commit 82446ddf fixes this pull-request
Pull-Request has been merged by jhrozek
Merges:
https://pagure.io/libuser/issue/26
The code used to first close(fd) and only then check if it's != -1.
Reverse the logic so that the fd is only closed if valid.