Skip to content

Commit

Permalink
Added SIGTERM handler for linux and closed session when reading error…
Browse files Browse the repository at this point in the history
… from tty
  • Loading branch information
CihatAltiparmak committed Jul 29, 2024
1 parent fcfed30 commit 8eba2f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rmw_zenoh_cpp/src/zenohd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ int main(int argc, char ** argv)
SetConsoleCtrlHandler(quit, TRUE);
#else
signal(SIGINT, quit);
signal(SIGTERM, quit);
#endif

KeyboardReader keyreader;
Expand All @@ -217,6 +218,8 @@ int main(int argc, char ** argv)
c = keyreader.readOne();
} catch (const std::runtime_error &) {
perror("read():");

z_close(z_move(s));
return -1;
}

Expand Down

0 comments on commit 8eba2f3

Please sign in to comment.