mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
img: Remove O_OPT and COLLECT_OPTIONAL
Current code doesn't make any difference between OPT and no-OPT except for the message is printed or not in the open_image(). So this particular change changes nothing but the availability of this message. In the next patches I wil introduce "empty images" to deal with the ENOENT situation in a more graceful manner. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
12
image.c
12
image.c
@@ -218,7 +218,7 @@ struct cr_img *open_image_at(int dfd, int type, unsigned long flags, ...)
|
||||
goto errn;
|
||||
|
||||
oflags |= imgset_template[type].oflags;
|
||||
flags &= ~(O_OPT | O_NOBUF);
|
||||
flags &= ~(O_NOBUF);
|
||||
|
||||
va_start(args, flags);
|
||||
vsnprintf(path, PATH_MAX, imgset_template[type].fmt, args);
|
||||
@@ -226,12 +226,10 @@ struct cr_img *open_image_at(int dfd, int type, unsigned long flags, ...)
|
||||
|
||||
ret = openat(dfd, path, flags, CR_FD_PERM);
|
||||
if (ret < 0) {
|
||||
if ((oflags & O_OPT) && errno == ENOENT) {
|
||||
xfree(img);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pr_perror("Unable to open %s", path);
|
||||
if (errno == ENOENT)
|
||||
pr_info("No %s image\n", path);
|
||||
else
|
||||
pr_perror("Unable to open %s", path);
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user