Actually return an error if something bad happens, don't just exit.

llvm-svn: 9119
This commit is contained in:
Chris Lattner 2003-10-14 21:07:25 +00:00
parent 6ad91d7166
commit 74d64c7d02
1 changed files with 4 additions and 5 deletions

View File

@ -306,8 +306,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
return ProgramResult; return ProgramResult;
} }
int GCC::MakeSharedObject(const std::string &InputFile, int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
FileType fileType,
std::string &OutputFile) { std::string &OutputFile) {
OutputFile = getUniqueFilename(InputFile+".so"); OutputFile = getUniqueFilename(InputFile+".so");
// Compile the C/asm file into a shared object // Compile the C/asm file into a shared object
@ -327,10 +326,10 @@ int GCC::MakeSharedObject(const std::string &InputFile,
}; };
std::cout << "<gcc>" << std::flush; std::cout << "<gcc>" << std::flush;
if(RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", if (RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null",
"/dev/null")) { "/dev/null")) {
ProcessFailure(GCCArgs); ProcessFailure(GCCArgs);
exit(1); return 1;
} }
return 0; return 0;
} }