mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-04 17:56:53 +00:00
reset errno to zero on entry to the application's main function. This fixes
MultiSource/Applications/minisat in the JIT. Note that the libsystem stuff should ideally never modify errno. :( llvm-svn: 36508
This commit is contained in:
parent
adae970e06
commit
bae21d5840
@ -28,7 +28,7 @@
|
||||
#include "llvm/System/Process.h"
|
||||
#include "llvm/System/Signals.h"
|
||||
#include <iostream>
|
||||
|
||||
#include <cerrno>
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
@ -128,6 +128,10 @@ int main(int argc, char **argv, char * const *envp) {
|
||||
// function later on to make an explicit call, so get the function now.
|
||||
Constant *Exit = Mod->getOrInsertFunction("exit", Type::VoidTy,
|
||||
Type::Int32Ty, NULL);
|
||||
|
||||
// Reset errno to zero on entry to main.
|
||||
errno = 0;
|
||||
|
||||
// Run static constructors.
|
||||
EE->runStaticConstructorsDestructors(false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user