path-util: simplify check_x_access()
Follow-up for ece852c8. This addresses the following comments by the Lennart: --- hmm, so this now does two access() calls for the case where the fd is not requested, and opens things up for races (theoretically, …). now, the access() code path was in place for optimization, but if an optimization is less sexy than the original (and i think it is less sexy, since more than one syscall, and non-atomic), i think we shouldn't do the optimization. maybe we should just always use open(O_PATH) now, and then fstat() it to check if regular file, and then access_fd() it for checking if its executable.
Loading