mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
inotify: Sanitize watches adding loop
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -245,7 +245,7 @@ err:
|
||||
static int restore_one_inotify(int inotify_fd, struct fsnotify_mark_info *info)
|
||||
{
|
||||
InotifyWdEntry *iwe = info->iwe;
|
||||
int ret = -1, wd, target = -1;
|
||||
int ret = -1, target = -1;
|
||||
char buf[32], *path;
|
||||
|
||||
path = get_mark_path("inotify", info->remap, iwe->f_handle,
|
||||
@@ -259,8 +259,9 @@ static int restore_one_inotify(int inotify_fd, struct fsnotify_mark_info *info)
|
||||
* this is suboptimal, but the kernel doesn't
|
||||
* provide and API for this yet :(
|
||||
*/
|
||||
wd = 1;
|
||||
while (wd >= 0) {
|
||||
while (1) {
|
||||
int wd;
|
||||
|
||||
wd = inotify_add_watch(inotify_fd, path, iwe->mask);
|
||||
if (wd < 0) {
|
||||
pr_perror("Can't add watch for %d with %d", inotify_fd, iwe->wd);
|
||||
|
Reference in New Issue
Block a user