mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-29 04:50:26 +00:00
img: Keep the copy of flags value in open_image_at
We drop the O_OPT from flags and will drop one more. So instead of a set of bools let's have the flags copy at hands. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
parent
78bbb0a161
commit
03482f69a2
1 changed files with 2 additions and 2 deletions
4
image.c
4
image.c
|
|
@ -199,7 +199,7 @@ struct cr_fdset *cr_glob_fdset_open(int mode)
|
|||
|
||||
int open_image_at(int dfd, int type, unsigned long flags, ...)
|
||||
{
|
||||
bool optional = !!(flags & O_OPT);
|
||||
unsigned long oflags = flags;
|
||||
char path[PATH_MAX];
|
||||
va_list args;
|
||||
int ret;
|
||||
|
|
@ -212,7 +212,7 @@ int open_image_at(int dfd, int type, unsigned long flags, ...)
|
|||
|
||||
ret = openat(dfd, path, flags, CR_FD_PERM);
|
||||
if (ret < 0) {
|
||||
if (optional && errno == ENOENT)
|
||||
if ((oflags & O_OPT) && errno == ENOENT)
|
||||
return -ENOENT;
|
||||
pr_perror("Unable to open %s", path);
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue