Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
76a25669
Commit
76a25669
authored
May 28, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/my/mysql-4.0 into mysql.com:/home/my/mysql-4.1
netware/BUILD/nwbootstrap: Auto merged
parents
2bb34ccb
7e788a81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
39 deletions
+69
-39
netware/mysqld_safe.c
netware/mysqld_safe.c
+69
-39
No files found.
netware/mysqld_safe.c
View file @
76a25669
...
...
@@ -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
);
}
/******************************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment