Skip to content
Commit 2a2806bb authored by Chris Friedt's avatar Chris Friedt Committed by Henrik Brix Andersen
Browse files

os: fdtable: restore errno if optional locking ioctl fails



The `zvfs_finalize_typed_fd()` function notifies some backends
via `ioctl()` with `ZFD_IOCTL_SET_LOCK`. However, support for
this method and functionality is optional.

In backends that do not support locking, this benign failure can
set `errno` to 95 (`EOPNOTSUPP`) in many circumstances where a
change in `errno` (indicating some kind of failure) is not
appropriate.

Prevent errno poisoning by backing-up and restoring `errno`.

Signed-off-by: default avatarChris Friedt <cfriedt@tenstorrent.com>
parent ba8025fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment