From: Imobach González Sosa Date: Mon, 18 May 2015 13:50:59 +0000 (+0100) Subject: Update from code review X-Git-Tag: v0.2.8~11^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a921e9d529fbe56dfaadd33da5eb7c50804a4ab;p=thirdparty%2Fsnapper.git Update from code review --- diff --git a/client/installation-helper.cc b/client/installation-helper.cc index 7b317ae0..eb691946 100644 --- a/client/installation-helper.cc +++ b/client/installation-helper.cc @@ -195,15 +195,15 @@ step4() cout << "done" << endl; } -void -step5(const string& root_prefix, const string& snapshot_type, unsigned int pre_num, const string& description, const map& userdata) +int +step5(const string& root_prefix, const string& description, const string& snapshot_type, + unsigned int pre_num, const map& userdata) { // fate #317973 // preconditions (maybe incomplete): // snapper rpms installed - unsigned int num; Snapshots::iterator snapshot; SCD scd; @@ -228,11 +228,11 @@ step5(const string& root_prefix, const string& snapshot_type, unsigned int pre_n catch (const runtime_error& e) { y2err("create snapshot failed, " << e.what()); - exit(EXIT_FAILURE); + return EXIT_FAILURE; } cout << snapshot->getNum() << endl; - exit(EXIT_SUCCESS); + return EXIT_SUCCESS; } @@ -277,7 +277,7 @@ main(int argc, char** argv) string default_subvolume_name; string description; string snapshot_type = "single"; - unsigned int pre_num; + unsigned int pre_num = 0; map userdata; GetOpts getopts; @@ -321,5 +321,5 @@ main(int argc, char** argv) else if (step == "4") step4(); else if (step == "5") - step5(root_prefix, snapshot_type, pre_num, description, userdata); + exit(step5(root_prefix, description, snapshot_type, pre_num, userdata)); }