Skip to content

Commit

Permalink
check rc of system call, eliminating unused warning
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusrussell committed Jun 19, 2023
1 parent f8d07f8 commit e5018b9
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 e5018b9

Please sign in to comment.