On 5/6/2025 7:40 PM, Jake Freeland wrote:
Use open(2) instead of access(2) to check for the existence of the target
device. This avoids a possible race condition where the the device file is
removed after a successful call to access(2) but before open(2).

This also fixes any potential bugs associated with passing open(2)-style
flags into access(2). i.e. access(2) does not formally support the O_RDWR
flag.

Signed-off-by: Jake Freeland <jf...@freebsd.org>
---

It's odd that static analysis didn't flag this, as that's the kind of thing it would normally complain about.

Acked-by: Anatoly Burakov <anatoly.bura...@intel.com>

--
Thanks,
Anatoly

Reply via email to