We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cbc0579 commit aba885cCopy full SHA for aba885c
backend/src/unix_platform.hpp
@@ -61,7 +61,9 @@ class UnixPlatform : public AbstractPlatform
61
int err;
62
struct stat file_stat;
63
64
- err = stat(this->path().c_str(), &file_stat);
+ const string &path = this->path();
65
+
66
+ err = stat(path.c_str(), &file_stat);
67
if (err == -1)
68
throw runtime_error("stat() failed");
69
@@ -75,10 +77,10 @@ class UnixPlatform : public AbstractPlatform
75
77
76
78
int fd;
79
- const char *path = this->path().c_str();
80
81
82
// Open the file.
- fd = open(path, O_RDONLY, 0);
83
+ fd = open(path.c_str(), O_RDONLY, 0);
84
if (fd < 0)
85
throw runtime_error(str(boost::format("fix_permissions: open() failed: %d.") % errno));
86
0 commit comments