2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

zdtm: Extend inotify00 test to have ghost file used

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov
2012-12-06 11:11:22 +04:00
committed by Pavel Emelyanov
parent b146fe4af6
commit d9df71dc87

View File

@@ -18,12 +18,14 @@
const char *test_doc = "Check for inotify delivery";
const char *test_author = "Cyrill Gorcunov <gorcunov@openvz.org>";
const char path[] = "inotify-removed";
#define BUFF_SIZE ((sizeof(struct inotify_event) + PATH_MAX))
int main (int argc, char *argv[])
{
char buf[BUFF_SIZE];
int fd, wd;
int fd, wd, deleted, wd_deleted;
test_init(argc, argv);
@@ -40,6 +42,23 @@ int main (int argc, char *argv[])
exit(1);
}
deleted = open(path, O_CREAT | O_TRUNC);
if (deleted < 0) {
fail("inotify_init failed");
exit(1);
}
wd_deleted = inotify_add_watch(fd, path, IN_ALL_EVENTS);
if (wd_deleted < 0) {
fail("inotify_add_watch failed");
exit(1);
}
if (unlink(path)) {
fail("can't unlink %s\n", path);
exit(1);
}
test_daemon();
test_waitsig();