diff options
author | Marc Laukien <marc@zeroc.com> | 2001-07-19 18:03:12 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-07-19 18:03:12 +0000 |
commit | e1605c7fc18ef05c35d8abbc7f538b66205ebade (patch) | |
tree | 30217edce6f774d313f8748865c40d70f9f917d1 /cpp/src/slice2cpp/Main.cpp | |
parent | fixes (diff) | |
download | ice-e1605c7fc18ef05c35d8abbc7f538b66205ebade.tar.bz2 ice-e1605c7fc18ef05c35d8abbc7f538b66205ebade.tar.xz ice-e1605c7fc18ef05c35d8abbc7f538b66205ebade.zip |
error checking
Diffstat (limited to 'cpp/src/slice2cpp/Main.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Main.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp index 98c21ca0058..5ca04edff48 100644 --- a/cpp/src/slice2cpp/Main.cpp +++ b/cpp/src/slice2cpp/Main.cpp @@ -128,6 +128,8 @@ main(int argc, char* argv[]) return EXIT_FAILURE; } + int status = EXIT_SUCCESS; + for(idx = 1 ; idx < argc ; ++idx) { string base(argv[idx]); @@ -169,7 +171,7 @@ main(int argc, char* argv[]) } Unit_ptr unit = Unit::createUnit(false, false); - int status = unit -> parse(cppHandle, debug); + int parseStatus = unit -> parse(cppHandle, debug); #ifdef WIN32 _pclose(cppHandle); @@ -177,16 +179,20 @@ main(int argc, char* argv[]) pclose(cppHandle); #endif - if(status == EXIT_FAILURE) - return status; - - Gen gen(argv[0], base, include, includePaths, dllExport); - if(!gen) - return EXIT_FAILURE; - gen.generate(unit); + if(parseStatus == EXIT_FAILURE) + { + status = EXIT_FAILURE; + } + else + { + Gen gen(argv[0], base, include, includePaths, dllExport); + if(!gen) + status = EXIT_FAILURE; + gen.generate(unit); + } unit -> destroy(); } - return EXIT_SUCCESS; + return status; } |