Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check rc of system call, eliminating unused warning #21

Merged
merged 1 commit into from
Jun 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/angular_servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ void killPigpiod() {
void startPigpiod() {
if (!isPigpiodRunning()) {
cout << "pigpio daemon not running. attempting to start it." << endl;
system("sudo systemctl start pigpiod");
int rc = system("sudo systemctl start pigpiod");
sleep(1);

if (isPigpiodRunning()) {
if (isPigpiodRunning() && (rc != -1)) {
// Successfully started the pigpiod daemon
cout << "pigpiod daemon started successfully" << endl;
} else {
Expand Down