citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 140d991f554bd8b3d3ad291d6c68f9a71eb8a728
parent aa7e38ff0589cbb83f563336922fc2b90c2af170
Author: Kyle Milz <kyle@windows.krwm.net>
Date:   Sun,  1 Jan 2017 21:24:40 -0800

src: convert inappropriate err{,x}() to m_log + exit

Diffstat:
Msrc/inst_frontend.cc | 18++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/inst_frontend.cc b/src/inst_frontend.cc @@ -90,8 +90,10 @@ InstFrontend::clean_PATH() { char *path; - if ((path = std::getenv("PATH")) == NULL) - errx(1, "Error: PATH is not set."); + if ((path = std::getenv("Path")) == NULL) { + m_log << "Error: PATH is not set." << std::endl; + exit(1); + } m_log << "PATH='" << path << "'" << std::endl; @@ -116,11 +118,15 @@ InstFrontend::clean_PATH() first_component = 0; } - if (!found_citrun_path) - errx(1, "Error: CITRUN_SHARE not in PATH."); + if (!found_citrun_path) { + m_log << "Error: CITRUN_SHARE not in PATH." << std::endl; + exit(1); + } - if (setenv("PATH", new_path.str().c_str(), 1)) - err(1, "setenv"); + if (_putenv_s("Path", new_path.str().c_str())) { + m_log << "setenv" << std::endl; + exit(1); + } }