Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
bda8e907
Commit
bda8e907
authored
Feb 05, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added protection against running under launchd
parent
fed2057a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
main.c
main.c
+11
-5
No files found.
main.c
View file @
bda8e907
...
...
@@ -252,12 +252,18 @@ static void process_command_line_arguments(char *argv[], char **options) {
(
void
)
fclose
(
fp
);
}
// Handle command line flags. They override config file and default settings.
for
(
i
=
cmd_line_opts_start
;
argv
[
i
]
!=
NULL
;
i
+=
2
)
{
if
(
argv
[
i
][
0
]
!=
'-'
||
argv
[
i
+
1
]
==
NULL
)
{
show_usage_and_exit
();
// If we're under MacOS and started by launchd, then the second
// argument is process serial number, -psn_.....
// In this case, don't process arguments at all.
if
(
argv
[
1
]
==
NULL
||
memcmp
(
argv
[
1
],
"-psn_"
,
5
)
!=
0
)
{
// Handle command line flags.
// They override config file and default settings.
for
(
i
=
cmd_line_opts_start
;
argv
[
i
]
!=
NULL
;
i
+=
2
)
{
if
(
argv
[
i
][
0
]
!=
'-'
||
argv
[
i
+
1
]
==
NULL
)
{
show_usage_and_exit
();
}
set_option
(
options
,
&
argv
[
i
][
1
],
argv
[
i
+
1
]);
}
set_option
(
options
,
&
argv
[
i
][
1
],
argv
[
i
+
1
]);
}
}
...
...
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