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.
2 parents 2c37acb + 985125a commit 386ea88Copy full SHA for 386ea88
src/util/run.cpp
@@ -53,9 +53,8 @@ using fdt = int;
53
/// open given file to replace either stdin, stderr, stdout
54
static fdt stdio_redirection(int fd, const std::string &file)
55
{
56
- fdt result_fd;
57
-
58
#ifdef _WIN32
+ fdt result_fd = INVALID_HANDLE_VALUE;
59
std::string name;
60
61
SECURITY_ATTRIBUTES SecurityAttributes;
@@ -142,7 +141,7 @@ static fdt stdio_redirection(int fd, const std::string &file)
142
141
UNREACHABLE;
143
}
144
145
- result_fd = open(file.c_str(), flags, mode);
+ const fdt result_fd = open(file.c_str(), flags, mode);
146
147
if(result_fd == -1)
148
perror(("Failed to open " + name + " file " + file).c_str());
0 commit comments