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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
8b3d267e
Commit
8b3d267e
authored
Dec 20, 2007
by
msvensson@pilot.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use Getopt::Long in safe_process.pl
parent
d930e9bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
mysql-test/lib/My/SafeProcess/safe_process.pl
mysql-test/lib/My/SafeProcess/safe_process.pl
+17
-7
No files found.
mysql-test/lib/My/SafeProcess/safe_process.pl
View file @
8b3d267e
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
use
strict
;
use
strict
;
use
warnings
;
use
warnings
;
use
Time::
localtime
;
use
lib
'
lib
';
use
lib
'
lib
';
use
My::SafeProcess::
Base
;
use
My::SafeProcess::
Base
;
use
POSIX
qw(WNOHANG)
;
use
POSIX
qw(WNOHANG)
;
...
@@ -19,6 +18,7 @@ use POSIX qw(WNOHANG);
...
@@ -19,6 +18,7 @@ use POSIX qw(WNOHANG);
my
$verbose
=
0
;
my
$verbose
=
0
;
sub
message
{
sub
message
{
if
(
$verbose
>
0
){
if
(
$verbose
>
0
){
use
Time::
localtime
;
my
$tm
=
localtime
();
my
$tm
=
localtime
();
my
$timestamp
=
sprintf
("
%02d%02d%02d %2d:%02d:%02d
",
my
$timestamp
=
sprintf
("
%02d%02d%02d %2d:%02d:%02d
",
$tm
->
year
%
100
,
$tm
->
mon
+
1
,
$tm
->
mday
,
$tm
->
year
%
100
,
$tm
->
mon
+
1
,
$tm
->
mday
,
...
@@ -43,16 +43,26 @@ $SIG{INT}= sub { message("!Got signal @_"); $terminated= 1; };
...
@@ -43,16 +43,26 @@ $SIG{INT}= sub { message("!Got signal @_"); $terminated= 1; };
my
$parent_pid
=
getppid
();
my
$parent_pid
=
getppid
();
use
Getopt::
Long
;
my
$found_double_dash
=
0
;
GetOptions
(
while
(
my
$arg
=
shift
(
@ARGV
)){
'
verbose
'
=>
\
$verbose
,
)
or
die
"
GetOptions failed
";
if
(
$arg
=~
/^--$/
){
shift
(
@ARGV
)
if
defined
(
$ARGV
[
0
])
and
$ARGV
[
0
]
eq
"
--
";
$found_double_dash
=
1
;
last
;
}
elsif
(
$arg
=~
/^--verbose$/
){
$verbose
=
1
;
}
else
{
die
"
Unknown option:
$arg
";
}
}
my
$path
=
shift
(
@ARGV
);
# Executable
my
$path
=
shift
(
@ARGV
);
# Executable
die
"
usage:
\n
"
.
die
"
usage:
\n
"
.
"
safe_process.pl [opts] -- <path> [<args> [...<args_n>]]
"
"
safe_process.pl [opts] -- <path> [<args> [...<args_n>]]
"
unless
defined
$path
;
unless
defined
$path
||
$found_double_dash
;
message
("
started
");
message
("
started
");
...
...
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