diff options
author | unknown <reggie@linux.site> | 2005-08-09 07:57:37 -0600 |
---|---|---|
committer | unknown <reggie@linux.site> | 2005-08-09 07:57:37 -0600 |
commit | 5d8222cd6f3ea3e7c35f1ab2d3d5a3d3d779d80e (patch) | |
tree | 5e2aee6ca4bb8a4b81567d9b0f3bfac0a799a66f /server-tools/instance-manager/mysqlmanager.cc | |
parent | 88c4ad2435063a19e6ba933b4fc2e1dfb802339a (diff) | |
download | mariadb-git-5d8222cd6f3ea3e7c35f1ab2d3d5a3d3d779d80e.tar.gz |
changes to IM that came from Petr and JimW's review.
server-tools/instance-manager/IMService.cpp:
make sure HandleServiceOptions returns 0 on success and 1 on failure
server-tools/instance-manager/mysqlmanager.cc:
default return value is 1.
simplify some code bits by just jumping to err on error.
move options.cleanup inside the err block. In this case, the err block
is more than just an error block. It is the terminating block
for both error and success. You set return_value to 0 for success
or leave it as 1 for failure. This simplies this function a bit.
server-tools/instance-manager/options.cc:
remove the malloc for default password filename on Windows and replace
with statically allocated memory.
default Options:saved_argv to NULL so that we will know if we need
to free it in cleanup()
setup the default config file location for Windows inside the
setup_windows_defaults function and remove this code from load()
rework setup_windows_defaults so that it properly returns 0 on success
and 1 on error and so it fills in the default location for the
log file, password file, and config file.
Diffstat (limited to 'server-tools/instance-manager/mysqlmanager.cc')
-rw-r--r-- | server-tools/instance-manager/mysqlmanager.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/server-tools/instance-manager/mysqlmanager.cc b/server-tools/instance-manager/mysqlmanager.cc index de80878e283..a1420a639cb 100644 --- a/server-tools/instance-manager/mysqlmanager.cc +++ b/server-tools/instance-manager/mysqlmanager.cc @@ -79,6 +79,7 @@ int HandleServiceOptions(Options options); int main(int argc, char *argv[]) { + int return_value= 1; init_environment(argv[0]); Options options; struct passwd *user_info; @@ -90,10 +91,7 @@ int main(int argc, char *argv[]) if ((user_info= check_user(options.user))) { if (set_user(options.user, user_info)) - { - options.cleanup(); goto err; - } } if (options.run_as_service) @@ -105,17 +103,18 @@ int main(int argc, char *argv[]) } #else #ifdef NDEBUG - return HandleServiceOptions(options); + return_value= HandleServiceOptions(options); + goto err; /* this is not always an error but we reuse the label */ #endif #endif manager(options); - options.cleanup(); - my_end(0); - return 0; + return_value= 0; + err: + options.cleanup(); my_end(0); - return 1; + return return_value; } /******************* Auxilary functions implementation **********************/ |