diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-30 20:29:23 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-04-01 08:13:18 +0200 |
commit | f9a726abefe1c25d952b36cd554e026e4c782967 (patch) | |
tree | 0af9baedf3a534d81c062a3aaa8a24cdcb7254c2 /src/libsystemd/libsystemd.sym | |
parent | fd-util: rename loop_get_diskseq() -> fd_get_diskseq() (diff) | |
download | systemd-f9a726abefe1c25d952b36cd554e026e4c782967.tar.xz systemd-f9a726abefe1c25d952b36cd554e026e4c782967.zip |
sd-device: introduce sd_device_open()
We usually open() device node obtained by sd_device_get_devname().
However, the device node corresponds to the sd-device object may be
already removed, and another device node with the same path may be
created, hence an unexpected device may be opened.
The sd_device_open() opens device node, and checks the devnum and
diskseq of opened devnum, to avoid the above possibility.
Prompted by https://github.com/systemd/systemd/issues/22906#issuecomment-1082736443.
Diffstat (limited to 'src/libsystemd/libsystemd.sym')
-rw-r--r-- | src/libsystemd/libsystemd.sym | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsystemd/libsystemd.sym b/src/libsystemd/libsystemd.sym index 0066894d54..bdf76b467b 100644 --- a/src/libsystemd/libsystemd.sym +++ b/src/libsystemd/libsystemd.sym @@ -775,4 +775,5 @@ global: sd_id128_to_uuid_string; sd_device_new_from_devname; sd_device_new_from_path; + sd_device_open; } LIBSYSTEMD_250; |