Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
693d0626
Commit
693d0626
authored
Apr 15, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings in caf-run
parent
aa804fe9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
tools/caf-run.cpp
tools/caf-run.cpp
+10
-4
No files found.
tools/caf-run.cpp
View file @
693d0626
...
@@ -238,13 +238,19 @@ void bootstrap(actor_system& system,
...
@@ -238,13 +238,19 @@ void bootstrap(actor_system& system,
run_ssh
(
system
,
wdir
,
oss
.
str
(),
master
.
host
);
run_ssh
(
system
,
wdir
,
oss
.
str
(),
master
.
host
);
}
}
#define RETURN_WITH_ERROR(output) \
do { \
::std::cerr << output << ::std::endl; \
return 1; \
} while (true)
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
actor_system_config
cfg
;
actor_system_config
cfg
;
cfg
.
parse
(
argc
,
argv
);
cfg
.
parse
(
argc
,
argv
);
if
(
cfg
.
cli_helptext_printed
)
if
(
cfg
.
cli_helptext_printed
)
return
0
;
return
0
;
if
(
cfg
.
slave_mode
)
if
(
cfg
.
slave_mode
)
return
cerr
<<
"cannot use slave mode in caf-run tool"
<<
endl
,
1
;
RETURN_WITH_ERROR
(
"cannot use slave mode in caf-run tool"
)
;
string
hostfile
;
string
hostfile
;
std
::
unique_ptr
<
char
,
void
(
*
)(
void
*
)
>
pwd
{
getcwd
(
nullptr
,
0
),
::
free
};
std
::
unique_ptr
<
char
,
void
(
*
)(
void
*
)
>
pwd
{
getcwd
(
nullptr
,
0
),
::
free
};
string
wdir
;
string
wdir
;
...
@@ -253,16 +259,16 @@ int main(int argc, char** argv) {
...
@@ -253,16 +259,16 @@ int main(int argc, char** argv) {
{
"wdir"
,
wdir
}
{
"wdir"
,
wdir
}
});
});
if
(
hostfile
.
empty
())
if
(
hostfile
.
empty
())
return
cerr
<<
"no hostfile specified or hostfile is empty"
<<
endl
,
1
;
RETURN_WITH_ERROR
(
"no hostfile specified or hostfile is empty"
)
;
auto
&
remainder
=
res
.
remainder
;
auto
&
remainder
=
res
.
remainder
;
if
(
remainder
.
empty
())
if
(
remainder
.
empty
())
return
cerr
<<
"empty command line"
<<
endl
,
1
;
RETURN_WITH_ERROR
(
"empty command line"
)
;
auto
cmd
=
std
::
move
(
remainder
.
get_mutable_as
<
std
::
string
>
(
0
));
auto
cmd
=
std
::
move
(
remainder
.
get_mutable_as
<
std
::
string
>
(
0
));
vector
<
string
>
xs
;
vector
<
string
>
xs
;
remainder
.
drop
(
1
).
extract
([
&
](
string
&
x
)
{
xs
.
emplace_back
(
std
::
move
(
x
));
});
remainder
.
drop
(
1
).
extract
([
&
](
string
&
x
)
{
xs
.
emplace_back
(
std
::
move
(
x
));
});
auto
hosts
=
read_hostfile
(
hostfile
);
auto
hosts
=
read_hostfile
(
hostfile
);
if
(
hosts
.
empty
())
if
(
hosts
.
empty
())
return
cerr
<<
"no valid entry in hostfile"
<<
endl
,
1
;
RETURN_WITH_ERROR
(
"no valid entry in hostfile"
)
;
actor_system
system
{
cfg
};
actor_system
system
{
cfg
};
auto
master
=
hosts
.
front
();
auto
master
=
hosts
.
front
();
hosts
.
erase
(
hosts
.
begin
());
hosts
.
erase
(
hosts
.
begin
());
...
...
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