udev-node: do not create symlink to a non-existing device node
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Sep 2022 21:07:09 +0000 (06:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Sep 2022 14:08:07 +0000 (23:08 +0900)
commit69928b4f152d3a282a7103720ae89cdb2517ef77
tree087ad12c2df41d5926e6f061356492f0df5600a2
parent13271e2ddecabd334a0aebc2c8fdaf582a4718c0
udev-node: do not create symlink to a non-existing device node

Previously, the stack directory contains empty regular files named with
device ID, and we create sd_device object from the device name.
Hence, we implicitly checked the existence of the device node.

However, now the files in the stack directory are symlink, and we
retrieve the path to the device node and its priority from the symlink.
Hence, the existence of the device node is not checked.
Let's check if the device node is still exist.
src/udev/udev-node.c