Skip to content

Commit 3075061

Browse files
Fix compiler warnings
1 parent 3fb3515 commit 3075061

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pink/src/pink_pubsub.cc

+6-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ int PubSubThread::Publish(const std::string& channel, const std::string &msg) {
141141
channel_ = channel;
142142
message_ = msg;
143143
// Send signal to ThreadMain()
144-
(void)write(msg_pfd_[1], "", 1);
144+
int ret_code = write(msg_pfd_[1], "", 1);
145+
(void)ret_code;
145146
receiver_mutex_.Lock();
146147
while (receivers_ == -1) {
147148
receiver_rsignal_.Wait();
@@ -384,7 +385,8 @@ void *PubSubThread::ThreadMain() {
384385
pfe = (pink_epoll_->firedevent()) + i;
385386
if (pfe->fd == pink_epoll_->notify_receive_fd()) { // New connection comming
386387
if (pfe->mask & PinkEpoll::kRead) {
387-
(void)read(pink_epoll_->notify_receive_fd(), triger, 1);
388+
int ret_code = read(pink_epoll_->notify_receive_fd(), triger, 1);
389+
(void)ret_code;
388390
{
389391
PinkItem ti = pink_epoll_->notify_queue_pop();
390392
if (ti.notify_type() == kNotiClose) {
@@ -404,7 +406,8 @@ void *PubSubThread::ThreadMain() {
404406
}
405407
if (pfe->fd == msg_pfd_[0]) { // Publish message
406408
if (pfe->mask & PinkEpoll::kRead) {
407-
(void)read(msg_pfd_[0], triger, 1);
409+
int ret_code = read(msg_pfd_[0], triger, 1);
410+
(void)ret_code;
408411
std::string channel, msg;
409412
int32_t receivers = 0;
410413
channel = channel_;

0 commit comments

Comments
 (0)