Check system() return when getting version information.
We were not checking the return of the two system calls used to get the version information from ivlpp and ivl. This patch adds checks and prints an appropriate message if they fail.
This commit is contained in:
parent
d4c62309eb
commit
87972adb04
|
|
@ -262,17 +262,24 @@ static const char*my_tempfile(const char*str, FILE**fout)
|
|||
|
||||
static int t_version_only(void)
|
||||
{
|
||||
int rc;
|
||||
remove(source_path);
|
||||
free(source_path);
|
||||
|
||||
fflush(0);
|
||||
snprintf(tmp, sizeof tmp, "%s%civlpp -V", pbase, sep);
|
||||
system(tmp);
|
||||
rc = system(tmp);
|
||||
if (rc != 0) {
|
||||
fprintf(stderr, "Unable to get version from \"%s\"\n", tmp);
|
||||
}
|
||||
|
||||
fflush(0);
|
||||
snprintf(tmp, sizeof tmp, "%s%civl -V -C%s -C%s", pbase, sep,
|
||||
iconfig_path, iconfig_common_path);
|
||||
system(tmp);
|
||||
rc = system(tmp);
|
||||
if (rc != 0) {
|
||||
fprintf(stderr, "Unable to get version from \"%s\"\n", tmp);
|
||||
}
|
||||
|
||||
if ( ! getenv("IVERILOG_ICONFIG")) {
|
||||
remove(iconfig_path);
|
||||
|
|
|
|||
Loading…
Reference in New Issue