Skip to content
Snippets Groups Projects
Commit 16c87027 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "fs_mgr: correct error handling"

parents 3f04e9e3 71867873
No related branches found
No related tags found
No related merge requests found
......@@ -163,7 +163,9 @@ bool fs_mgr_wants_overlayfs() {
// Overlayfs available in the kernel, and patched for override_creds?
static signed char overlayfs_in_kernel = -1; // cache for constant condition
if (overlayfs_in_kernel == -1) {
auto save_errno = errno;
overlayfs_in_kernel = !access("/sys/module/overlay/parameters/override_creds", F_OK);
errno = save_errno;
}
return overlayfs_in_kernel;
}
......@@ -429,7 +431,7 @@ bool fs_mgr_overlayfs_teardown(const char* mount_point, bool* change) {
const auto newpath = oldpath + ".teardown";
ret &= fs_mgr_rm_all(newpath);
auto save_errno = errno;
if (rename(oldpath.c_str(), newpath.c_str())) {
if (!rename(oldpath.c_str(), newpath.c_str())) {
if (change) *change = true;
} else if (errno != ENOENT) {
ret = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment