2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

test/zdtm/static/inotify_system.c: s/inot/infd/

Codespell thinks that "inot" is a misspelled "into".

Rename to infd ("inotify fd") to make it happy.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2022-03-30 17:42:23 -07:00
committed by Andrei Vagin
parent 0cb8b9c044
commit 58d76cb160

View File

@@ -63,7 +63,7 @@ const char *inot_dir = "./inotify.nodel";
#include <fcntl.h> #include <fcntl.h>
typedef struct { typedef struct {
int inot; int infd;
int file; int file;
int link; int link;
int dir; int dir;
@@ -165,8 +165,8 @@ desc init_env(const char *dir, char *file_path, char *link_path)
pr_perror("mkdir(%s)", dir); pr_perror("mkdir(%s)", dir);
return in_desc; return in_desc;
} }
in_desc.inot = inotify_init(); in_desc.infd = inotify_init();
if (in_desc.inot < 0) { if (in_desc.infd < 0) {
pr_perror("inotify_init() failed"); pr_perror("inotify_init() failed");
rmdir(dir); rmdir(dir);
return in_desc; return in_desc;
@@ -184,12 +184,12 @@ desc init_env(const char *dir, char *file_path, char *link_path)
return in_desc; return in_desc;
} }
in_desc.dir = addWatcher(in_desc.inot, dir); in_desc.dir = addWatcher(in_desc.infd, dir);
if (createFiles(file_path, filename, link_path)) { if (createFiles(file_path, filename, link_path)) {
return in_desc; return in_desc;
} }
in_desc.link = addWatcher(in_desc.inot, link_path); in_desc.link = addWatcher(in_desc.infd, link_path);
in_desc.file = addWatcher(in_desc.inot, file_path); in_desc.file = addWatcher(in_desc.infd, file_path);
return in_desc; return in_desc;
} }
@@ -299,9 +299,9 @@ int read_set(int inot_fd, char *event_set)
void common_close(desc *descr) void common_close(desc *descr)
{ {
if (descr->inot > 0) { if (descr->infd > 0) {
close(descr->inot); close(descr->infd);
descr->inot = -1; descr->infd = -1;
descr->file = -1; descr->file = -1;
descr->dir = -1; descr->dir = -1;
descr->link = -1; descr->link = -1;
@@ -316,7 +316,7 @@ int get_event_set(char *event_set, int wait)
desc common_desc; desc common_desc;
common_desc = init_env(inot_dir, file_path, link_path); common_desc = init_env(inot_dir, file_path, link_path);
if ((common_desc.inot < 0) || (common_desc.file < 0) || (common_desc.dir < 0) || (common_desc.link < 0)) { if ((common_desc.infd < 0) || (common_desc.file < 0) || (common_desc.dir < 0) || (common_desc.link < 0)) {
common_close(&common_desc); common_close(&common_desc);
return -1; return -1;
} }
@@ -327,7 +327,7 @@ int get_event_set(char *event_set, int wait)
if (wait) { if (wait) {
do_wait(); do_wait();
} }
len = read_set(common_desc.inot, event_set); len = read_set(common_desc.infd, event_set);
common_close(&common_desc); common_close(&common_desc);
#ifdef NODEL #ifdef NODEL
if (!(fDelete(file_path) == 0 && fDelete(link_path) == 0 && fRemDir(inot_dir) == 0)) if (!(fDelete(file_path) == 0 && fDelete(link_path) == 0 && fRemDir(inot_dir) == 0))