diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-30 14:21:43 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-12-02 08:02:19 +0100 |
commit | cb8cd417de869517b4c5a30a201602e76e94aae4 (patch) | |
tree | c554243067bdf791633f6b704db51012f32d6c4b /solenv | |
parent | ac5d4693ce4ec3fc1b10c83c27d09ca61de8188f (diff) |
Be explicit about missing env vars
Change-Id: I1023779749c3ce114d637a39a72bc9038324f01d
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gcc-wrappers/wrapper.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx index e68603c14013..0c6093434b59 100644 --- a/solenv/gcc-wrappers/wrapper.cxx +++ b/solenv/gcc-wrappers/wrapper.cxx @@ -37,6 +37,10 @@ void setupccenv() { char* libbuf; size_t liblen; _dupenv_s(&libbuf,&liblen,"ILIB"); + if (libbuf == nullptr) { + std::cerr << "No environment variable ILIB" << std::endl; + std::exit(EXIT_FAILURE); + } libpath.append(libbuf); free(libbuf); if(_putenv(libpath.c_str())<0) { @@ -49,6 +53,10 @@ void setupccenv() { char* incbuf; size_t inclen; _dupenv_s(&incbuf,&inclen,"SOLARINC"); + if (incbuf == nullptr) { + std::cerr << "No environment variable SOLARINC" << std::endl; + std::exit(EXIT_FAILURE); + } string inctmp(incbuf); free(incbuf); |