From 87972adb044304f9f9d8fff071fe485a88dac188 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 10 Dec 2008 17:16:25 -0800 Subject: [PATCH] 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. --- driver/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/driver/main.c b/driver/main.c index 3b049f278..f6cb3ab09 100644 --- a/driver/main.c +++ b/driver/main.c @@ -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);