We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4cf722 commit d29efa6Copy full SHA for d29efa6
1 file changed
src/main.cpp
@@ -14,7 +14,7 @@ static SystemMonitor* g_monitor = nullptr;
14
static void signalHandler(int signum) {
15
// write() является async-signal-safe в отличие от std::cout
16
const char msg[] = "\nReceived signal, shutting down...\n";
17
- write(STDOUT_FILENO, msg, sizeof(msg) - 1);
+ if (write(STDOUT_FILENO, msg, sizeof(msg) - 1) < 0) { /* async-signal-safe, ошибку игнорируем */ }
18
(void)signum;
19
if (g_monitor) {
20
g_monitor->stop();
0 commit comments