From: Imobach González Sosa Date: Mon, 18 May 2015 14:44:24 +0000 (+0100) Subject: Add proper management of exit code for step5 installation helper X-Git-Tag: v0.2.8~11^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7caabb04d05cd6ad28dc947f959d14e28fe92440;p=thirdparty%2Fsnapper.git Add proper management of exit code for step5 installation helper --- diff --git a/client/installation-helper.cc b/client/installation-helper.cc index eb691946..aa49ebc0 100644 --- a/client/installation-helper.cc +++ b/client/installation-helper.cc @@ -195,7 +195,7 @@ step4() cout << "done" << endl; } -int +bool step5(const string& root_prefix, const string& description, const string& snapshot_type, unsigned int pre_num, const map& userdata) { @@ -228,11 +228,11 @@ step5(const string& root_prefix, const string& description, const string& snapsh catch (const runtime_error& e) { y2err("create snapshot failed, " << e.what()); - return EXIT_FAILURE; + return false; } cout << snapshot->getNum() << endl; - return EXIT_SUCCESS; + return true; } @@ -321,5 +321,5 @@ main(int argc, char** argv) else if (step == "4") step4(); else if (step == "5") - exit(step5(root_prefix, description, snapshot_type, pre_num, userdata)); + return step5(root_prefix, description, snapshot_type, pre_num, userdata) ? EXIT_SUCCESS : EXIT_FAILURE; }