Skip to content

Commit

Permalink
OSLCompiler : Check for write errors (AcademySoftwareFoundation#1360)
Browse files Browse the repository at this point in the history
Fixes AcademySoftwareFoundation#1352

Signed-off-by: John Haddon <[email protected]>
  • Loading branch information
johnhaddon authored and lgritz committed Apr 22, 2021
1 parent e13f3cd commit a2b97d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/liboslcomp/oslcomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,13 @@ OSLCompilerImpl::compile(string_view filename,
write_oso_file(OIIO::Strutil::join(options, " "),
preprocess_result);
OSL_DASSERT(m_osofile == nullptr);

oso_output.close();
if (!oso_output.good()) {
errorf(ustring(), 0, "Failed to write to \"%s\"",
m_output_filename);
return false;
}
}

oslcompiler = nullptr;
Expand Down

0 comments on commit a2b97d0

Please sign in to comment.