summaryrefslogtreecommitdiff
path: root/netware
diff options
context:
space:
mode:
authorunknown <jani@a80-186-24-72.elisa-laajakaista.fi>2004-05-27 23:39:50 +0300
committerunknown <jani@a80-186-24-72.elisa-laajakaista.fi>2004-05-27 23:39:50 +0300
commitd5d9f915750670a53674b438a9574ca91f869462 (patch)
tree5bc1bb494b1f87b2696a47ddf5de4c4ab99d0343 /netware
parentb4a4bc47b414690e1f7299c771b4cf4ef43aa76a (diff)
downloadmariadb-git-d5d9f915750670a53674b438a9574ca91f869462.tar.gz
Merged in some patches from Novell.
netware/BUILD/nwbootstrap: Patch from Novell, create the libmysqld.imp file. netware/mysqld_safe.c: Patch from Novell, new option --set-variable.
Diffstat (limited to 'netware')
-rwxr-xr-xnetware/BUILD/nwbootstrap5
-rw-r--r--netware/mysqld_safe.c108
2 files changed, 74 insertions, 39 deletions
diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap
index f54775bf054..ba6d34bddc8 100755
--- a/netware/BUILD/nwbootstrap
+++ b/netware/BUILD/nwbootstrap
@@ -171,6 +171,11 @@ do
rm $file.org
done
+# create the libmysql.imp file in netware folder from libmysql/libmysql.def
+# file
+echo "generating llibmysql.imp file..."
+awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp
+
# build linux tools
echo "compiling linux tools..."
./netware/BUILD/compile-linux-tools
diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c
index a815497ac0f..8d4a5c4a296 100644
--- a/netware/mysqld_safe.c
+++ b/netware/mysqld_safe.c
@@ -67,6 +67,7 @@ void check_data_vol();
void check_setup();
void check_tables();
void mysql_start(int, char*[]);
+void parse_setvar(char *arg);
/******************************************************************************
@@ -321,7 +322,8 @@ void parse_args(int argc, char *argv[])
OPT_ERR_LOG,
OPT_SAFE_LOG,
OPT_MYSQLD,
- OPT_HELP
+ OPT_HELP,
+ OPT_SETVAR
};
static struct option options[] =
@@ -337,6 +339,7 @@ void parse_args(int argc, char *argv[])
{"safe-log", required_argument, 0, OPT_SAFE_LOG},
{"mysqld", required_argument, 0, OPT_MYSQLD},
{"help", no_argument, 0, OPT_HELP},
+ {"set-variable", required_argument, 0, OPT_SETVAR},
{0, 0, 0, 0}
};
@@ -384,7 +387,11 @@ void parse_args(int argc, char *argv[])
case OPT_MYSQLD:
strcpy(mysqld, optarg);
break;
-
+
+ case OPT_SETVAR:
+ parse_setvar(optarg);
+ break;
+
case OPT_HELP:
usage();
break;
@@ -396,6 +403,25 @@ void parse_args(int argc, char *argv[])
}
}
+/*
+ parse_setvar(char *arg)
+ Pasrsing for port just to display the port num on the mysqld_safe screen
+*/
+void parse_setvar(char *arg)
+{
+ char *pos;
+
+ if ((pos= strindex(arg, "port")))
+ {
+ for (; *pos && *pos != '='; pos++) ;
+ if (*pos)
+ strcpy(port, pos + 1);
+ }
+}
+/******************************************************************************
+
+
+
/******************************************************************************
get_options()
@@ -599,32 +625,32 @@ void check_tables()
******************************************************************************/
void mysql_start(int argc, char *argv[])
{
- arg_list_t al;
- int i, j, err;
- struct stat info;
- time_t cal;
- struct tm lt;
- char stamp[PATH_MAX];
- char skip;
+ arg_list_t al;
+ int i, j, err;
+ struct stat info;
+ time_t cal;
+ struct tm lt;
+ char stamp[PATH_MAX];
+ char skip;
// private options
static char *private_options[] =
{
- "--autoclose",
+ "--autoclose",
"--check-tables",
"--help",
- "--err-log=",
- "--mysqld=",
- NULL
+ "--err-log=",
+ "--mysqld=",
+ NULL
};
- // args
- init_args(&al);
- add_arg(&al, "%s", mysqld);
-
- // parent args
- for(i = 1; i < argc; i++)
- {
+ // args
+ init_args(&al);
+ add_arg(&al, "%s", mysqld);
+
+ // parent args
+ for(i = 1; i < argc; i++)
+ {
skip = FALSE;
// skip private arguments
@@ -633,38 +659,42 @@ void mysql_start(int argc, char *argv[])
if(!strnicmp(argv[i], private_options[j], strlen(private_options[j])))
{
skip = TRUE;
+ consoleprintf("The argument skipped is %s\n",argv[i]);
break;
}
}
-
- if (!skip) add_arg(&al, "%s", argv[i]);
- }
-
+
+ if (!skip)
+ {
+ add_arg(&al, "%s", argv[i]);
+ consoleprintf("The final argument is %s\n",argv[i]);
+ }
+ }
// spawn
- do
- {
- // check the database tables
- if (checktables) check_tables();
-
- // status
+ do
+ {
+ // check the database tables
+ if (checktables) check_tables();
+
+ // status
time(&cal);
localtime_r(&cal, &lt);
strftime(stamp, PATH_MAX, "%d %b %Y %H:%M:%S", &lt);
log("mysql started : %s\n", stamp);
-
- // spawn mysqld
- spawn(mysqld, &al, TRUE, NULL, NULL, err_log);
- }
- while (!stat(pid_file, &info));
-
- // status
+
+ // spawn mysqld
+ spawn(mysqld, &al, TRUE, NULL, NULL, err_log);
+ }
+ while (!stat(pid_file, &info));
+
+ // status
time(&cal);
localtime_r(&cal, &lt);
strftime(stamp, PATH_MAX, "%d %b %Y %H:%M:%S", &lt);
log("mysql stopped : %s\n\n", stamp);
- // free args
- free_args(&al);
+ // free args
+ free_args(&al);
}
/******************************************************************************