main: correctly report copyup error

the copyup function returns the error code set in ret.  Make sure ret
has the correct return code if set_fd_origin fails.

Closes: https://github.com/containers/fuse-overlayfs/issues/211

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2020-05-26 22:19:52 +02:00
parent 222c3a1901
commit 6d75146e29
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

3
main.c
View File

@ -2704,7 +2704,8 @@ copyup (struct ovl_data *lo, struct ovl_node *node)
if (ret < 0) if (ret < 0)
goto exit; goto exit;
if (set_fd_origin (dfd, node->path) < 0) ret = set_fd_origin (dfd, node->path);
if (ret < 0)
goto exit; goto exit;
/* Finally, move the file to its destination. */ /* Finally, move the file to its destination. */