Skip to content

Commit

Permalink
TgBot++: socket: utils_posix: Don't ignore return value of write
Browse files Browse the repository at this point in the history
  • Loading branch information
Royna2544 committed Feb 19, 2024
1 parent 112c430 commit 5be2256
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/socket/SocketUtils_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ void writeToSocket(struct TgBotConnection conn) {
void forceStopListening(void) {
if (isValidFd(notify_fd) && isValidFd(listen_fd)) {
kListenData d = 0;
write(notify_fd, &d, sizeof(kListenData));
int count;

count = write(notify_fd, &d, sizeof(kListenData));
if (count < 0) {
PLOG_E("Failed to write to notify pipe");
}
closeFd(notify_fd);
}
}

0 comments on commit 5be2256

Please sign in to comment.