We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bde6e0e commit aedd6c5Copy full SHA for aedd6c5
1 file changed
jitify2.hpp
@@ -4118,6 +4118,10 @@ inline int run_system_command(const char* command,
4118
while (fgets(buffer.data(), static_cast<int>(buffer.size()), pipe)) {
4119
*output += buffer.data();
4120
}
4121
+ } else {
4122
+ // Must always read from the pipe for the exit code from the command to be available
4123
+ std::array<char, 128> buffer;
4124
+ while (fgets(buffer.data(), static_cast<int>(buffer.size()), pipe)) { }
4125
4126
const int result = JITIFY_PCLOSE(pipe);
4127
if (result == -1 && failure) {
@@ -4135,7 +4139,6 @@ inline int run_system_command(const char* command,
4135
4139
exitCode = WEXITSTATUS(result);
4136
4140
4137
4141
#endif
4138
-
4142
return exitCode;
4143
4144
#endif // JITIFY_ENABLE_NVCC
0 commit comments