From 5e0e9730cadf1261074f67a0b80917ee9e1757e8 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Fri, 9 Jun 2023 19:02:25 +0900 Subject: [PATCH] tests: (mkfds) add / and /etc/fstab as the monitoring targets to inotify Signed-off-by: Masatake YAMATO --- tests/helpers/test_mkfds.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/helpers/test_mkfds.c b/tests/helpers/test_mkfds.c index 0afb962485..ff6e930874 100644 --- a/tests/helpers/test_mkfds.c +++ b/tests/helpers/test_mkfds.c @@ -823,6 +823,20 @@ static void *make_inotify_fd(const struct factory *factory _U_, struct fdesc fde if (fd < 0) err(EXIT_FAILURE, "failed in inotify_init()"); + if (inotify_add_watch(fd, "/", IN_DELETE) < 0) { + int e = errno; + close(fd); + errno = e; + err(EXIT_FAILURE, "failed in inotify_add_watch(\"/\")"); + } + + if (inotify_add_watch(fd, "/etc/fstab", IN_DELETE) < 0) { + int e = errno; + close(fd); + errno = e; + err(EXIT_FAILURE, "failed in inotify_add_watch(\"/etc/fstab\")"); + } + if (fd != fdescs[0].fd) { if (dup2(fd, fdescs[0].fd) < 0) { int e = errno; -- 2.47.3