From bd97980193a32c4b87c64dd4a041d25c7f841d5e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 22 Jan 2022 00:13:28 +0900 Subject: [PATCH] udevadm: do not remove watch directory See the comment in the code. --- src/udev/udevadm-info.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index 018a52ada8..3535517183 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -313,7 +313,7 @@ static void cleanup_dirs_after_db_cleanup(DIR *dir, DIR *datadir) { } static void cleanup_db(void) { - _cleanup_closedir_ DIR *dir1 = NULL, *dir2 = NULL, *dir3 = NULL, *dir4 = NULL, *dir5 = NULL; + _cleanup_closedir_ DIR *dir1 = NULL, *dir2 = NULL, *dir3 = NULL, *dir4 = NULL; dir1 = opendir("/run/udev/data"); if (dir1) @@ -331,9 +331,8 @@ static void cleanup_db(void) { if (dir4) cleanup_dir(dir4, 0, 2); - dir5 = opendir("/run/udev/watch"); - if (dir5) - cleanup_dir_after_db_cleanup(dir5, dir1); + /* Do not remove /run/udev/watch. It will be handled by udevd well on restart. + * And should not be removed by external program when udevd is running. */ } static int query_device(QueryType query, sd_device* device) { -- 2.25.1