libxc: Only retry mapping pages when ENOENT is returned

If the return value from the ioctl() is not ENOENT, it's possible that err[i]
will not be updated and libxc will just loop forever.  Although it's unlikely
that err[i] would not be updated after the ioctl() gets through at least once,
it's better to be defensive.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Andres Lagar-Cavilla committed 2012-01-10 15:35:01 +00:00
1 parent 6fd2fba594
commit e9f7017afe
1 file changed
+1 -1
+1 -1
View File
@@ -232,7 +232,7 @@ static void *linux_privcmd_map_foreign_bulk(xc_interface *xch, xc_osdep_handle h
do {
usleep(100);
rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
} while ( rc < 0 && err[i] == -ENOENT );
} while ( rc < 0 && errno == ENOENT && err[i] == -ENOENT );
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.