From 8a09948745f529dd7d855919767423d7739dbc3a Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Sun, 7 Oct 2018 09:08:26 +0200 Subject: [PATCH] shared: netcon: suppress gcc warning --- src/utils/netcon.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils/netcon.cpp b/src/utils/netcon.cpp index 02492e91..4ac3815d 100644 --- a/src/utils/netcon.cpp +++ b/src/utils/netcon.cpp @@ -701,7 +701,10 @@ void NetconData::cancelReceive() { if (m_wkfds[1] >= 0) { LOGDEB2("NetconData::cancelReceive: writing to " << m_wkfds[1] << endl); - ::write(m_wkfds[1], "!", 1); + // We can't do a thing about the ::write return value, the + // following nonsense is for cancelling warnings + int ret = ::write(m_wkfds[1], "!", 1); + ret = ret; } } @@ -750,7 +753,10 @@ int NetconData::receive(char *buf, int cnt, int timeo) if (cancellable && FD_ISSET(m_wkfds[0], &rd)) { char b[100]; - read(m_wkfds[0], b, 100); + // We can't do a thing about the return value, the + // following nonsense is for cancelling warnings + int ret = ::read(m_wkfds[0], b, 100); + ret = ret; return Cancelled; }