Commit 03482f69 authored by Pavel Emelyanov's avatar Pavel Emelyanov

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: 's avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 78bbb0a1
...@@ -199,7 +199,7 @@ struct cr_fdset *cr_glob_fdset_open(int mode) ...@@ -199,7 +199,7 @@ struct cr_fdset *cr_glob_fdset_open(int mode)
int open_image_at(int dfd, int type, unsigned long flags, ...) int open_image_at(int dfd, int type, unsigned long flags, ...)
{ {
bool optional = !!(flags & O_OPT); unsigned long oflags = flags;
char path[PATH_MAX]; char path[PATH_MAX];
va_list args; va_list args;
int ret; int ret;
...@@ -212,7 +212,7 @@ int open_image_at(int dfd, int type, unsigned long flags, ...) ...@@ -212,7 +212,7 @@ int open_image_at(int dfd, int type, unsigned long flags, ...)
ret = openat(dfd, path, flags, CR_FD_PERM); ret = openat(dfd, path, flags, CR_FD_PERM);
if (ret < 0) { if (ret < 0) {
if (optional && errno == ENOENT) if ((oflags & O_OPT) && errno == ENOENT)
return -ENOENT; return -ENOENT;
pr_perror("Unable to open %s", path); pr_perror("Unable to open %s", path);
goto err; goto err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment