Commit cfec65e6 authored by Andrew Ayer's avatar Andrew Ayer

Fix resolution of ROOTDIR

* Print error message if realpath fails (e.g. path does not exist).
* Avoid memory leak.
parent 20c29507
......@@ -251,7 +251,13 @@ int main (int argc, char** argv)
return 2;
}
root = realpath(bare_arguments[0].c_str(), NULL);
if (char* resolved_path = realpath(bare_arguments[0].c_str(), nullptr)) {
root = resolved_path;
std::free(resolved_path);
} else {
std::perror(bare_arguments[0].c_str());
return 1;
}
// Add some of our own hard-coded FUSE options:
fuse_opt_add_arg(&fargs, "-o");
......
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