diff options
author | unknown <petr@mysql.com> | 2005-10-21 03:27:18 +0400 |
---|---|---|
committer | unknown <petr@mysql.com> | 2005-10-21 03:27:18 +0400 |
commit | 885a0c14cd439927667e46bf6f06fcabdbc710e7 (patch) | |
tree | 09cad43f225c6018c15390928da7110f41700e9e /server-tools/instance-manager | |
parent | 9e23aa1126c5fd820969cedd595b9a4b9e1df30e (diff) | |
parent | a5f2355cf6d9d4dd71de428410d0b805340c2d71 (diff) | |
download | mariadb-git-885a0c14cd439927667e46bf6f06fcabdbc710e7.tar.gz |
Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/cps/mysql/trees/mysql-5.0
Diffstat (limited to 'server-tools/instance-manager')
-rw-r--r-- | server-tools/instance-manager/instance.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc index 945f8abe3c2..0756f0b4d9f 100644 --- a/server-tools/instance-manager/instance.cc +++ b/server-tools/instance-manager/instance.cc @@ -138,15 +138,25 @@ static int wait_process(My_process_info *pi) static int start_process(Instance_options *instance_options, My_process_info *pi) { +#ifndef __QNX__ *pi= fork(); +#else + /* + On QNX one cannot use fork() in multithreaded environment and we + should use spawn() or one of it's siblings instead. + Here we use spawnv(), which is a combination of fork() and execv() + in one call. It returns the pid of newly created process (>0) or -1 + */ + *pi= spawnv(P_NOWAIT, instance_options->mysqld_path, instance_options->argv); +#endif switch (*pi) { - case 0: + case 0: /* never happens on QNX */ execv(instance_options->mysqld_path, instance_options->argv); /* exec never returns */ exit(1); - case 1: - log_info("cannot fork() to start instance %s", + case -1: + log_info("cannot create a new process to start instance %s", instance_options->instance_name); return 1; } |