mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-12 09:17:44 +03:00
unlink old database file before creating a new one
udev_db_add_device() can be called when the corressponding database entry already exists - it should overwrite the old entry in this case. However, if the old entry was a symlink, fopen(filename, "w") will not overwrite it properly - it will keep the symlink and create a file named after the symlink target. Calling unlink(filename) before trying to create the database file fixes the problem. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
This commit is contained in:
parent
27283c2fda
commit
e0c0807ab3
Loading…
Reference in New Issue
Block a user