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
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
Hide 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 @@
use
strict
;
use
warnings
;
use
Time::
localtime
;
use
lib
'
lib
';
use
My::SafeProcess::
Base
;
use
POSIX
qw(WNOHANG)
;
...
...
@@ -19,6 +18,7 @@ use POSIX qw(WNOHANG);
my
$verbose
=
0
;
sub
message
{
if
(
$verbose
>
0
){
use
Time::
localtime
;
my
$tm
=
localtime
();
my
$timestamp
=
sprintf
("
%02d%02d%02d %2d:%02d:%02d
",
$tm
->
year
%
100
,
$tm
->
mon
+
1
,
$tm
->
mday
,
...
...
@@ -43,16 +43,26 @@ $SIG{INT}= sub { message("!Got signal @_"); $terminated= 1; };
my
$parent_pid
=
getppid
();
use
Getopt::
Long
;
GetOptions
(
'
verbose
'
=>
\
$verbose
,
)
or
die
"
GetOptions failed
";
shift
(
@ARGV
)
if
defined
(
$ARGV
[
0
])
and
$ARGV
[
0
]
eq
"
--
";
my
$found_double_dash
=
0
;
while
(
my
$arg
=
shift
(
@ARGV
)){
if
(
$arg
=~
/^--$/
){
$found_double_dash
=
1
;
last
;
}
elsif
(
$arg
=~
/^--verbose$/
){
$verbose
=
1
;
}
else
{
die
"
Unknown option:
$arg
";
}
}
my
$path
=
shift
(
@ARGV
);
# Executable
die
"
usage:
\n
"
.
"
safe_process.pl [opts] -- <path> [<args> [...<args_n>]]
"
unless
defined
$path
;
unless
defined
$path
||
$found_double_dash
;
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