Skip to content

Commit

Permalink
Merge pull request #21 from atticusrussell/18-fix-unused-warning
Browse files Browse the repository at this point in the history
check rc of system call, eliminating unused warning
  • Loading branch information
atticusrussell committed Jun 19, 2023
2 parents f8d07f8 + e5018b9 commit 422d0f6
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 422d0f6

Please sign in to comment.