From: Masatake YAMATO Date: Fri, 9 Jun 2023 10:02:25 +0000 (+0900) Subject: tests: (mkfds) add / and /etc/fstab as the monitoring targets to inotify X-Git-Tag: v2.40-rc1~389^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e0e9730cadf1261074f67a0b80917ee9e1757e8;p=thirdparty%2Futil-linux.git tests: (mkfds) add / and /etc/fstab as the monitoring targets to inotify Signed-off-by: Masatake YAMATO --- 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;