Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
50cdb011
Commit
50cdb011
authored
6 years ago
by
Beat Küng
Browse files
Options
Downloads
Patches
Plain Diff
rover_steering_control: avoid using exit()
parent
258f7a7f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/examples/rover_steering_control/main.cpp
+6
-6
6 additions, 6 deletions
src/examples/rover_steering_control/main.cpp
with
6 additions
and
6 deletions
src/examples/rover_steering_control/main.cpp
+
6
−
6
View file @
50cdb011
...
...
@@ -395,7 +395,6 @@ usage(const char *reason)
}
fprintf
(
stderr
,
"usage: rover_steering_control {start|stop|status}
\n\n
"
);
exit
(
1
);
}
/**
...
...
@@ -410,6 +409,7 @@ int rover_steering_control_main(int argc, char *argv[])
{
if
(
argc
<
2
)
{
usage
(
"missing command"
);
return
1
;
}
if
(
!
strcmp
(
argv
[
1
],
"start"
))
{
...
...
@@ -417,7 +417,7 @@ int rover_steering_control_main(int argc, char *argv[])
if
(
thread_running
)
{
warnx
(
"running"
);
/* this is not an error */
exit
(
0
)
;
return
0
;
}
thread_should_exit
=
false
;
...
...
@@ -428,12 +428,12 @@ int rover_steering_control_main(int argc, char *argv[])
rover_steering_control_thread_main
,
(
argv
)
?
(
char
*
const
*
)
&
argv
[
2
]
:
(
char
*
const
*
)
nullptr
);
thread_running
=
true
;
exit
(
0
)
;
return
0
;
}
if
(
!
strcmp
(
argv
[
1
],
"stop"
))
{
thread_should_exit
=
true
;
exit
(
0
)
;
return
0
;
}
if
(
!
strcmp
(
argv
[
1
],
"status"
))
{
...
...
@@ -444,11 +444,11 @@ int rover_steering_control_main(int argc, char *argv[])
warnx
(
"not started"
);
}
exit
(
0
)
;
return
0
;
}
usage
(
"unrecognized command"
);
exit
(
1
)
;
return
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment