1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 10:35:10 +00:00

Fix warning about unused result in strerror_r() redefinition

On systems, the buildprocess will complain:
  [  7%] Building CXX object src/CMakeFiles/conky.dir/c++wrap.cc.o
  conky/src/c++wrap.cc: In function ‘std::string strerror_r(int)’:
  conky/src/c++wrap.cc:66:37: warning: ignoring return value of ‘char* strerror_r(int, char*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]

According to "man 3 strerror_r" the buffer used as 2nd arg is not always used, this patch also fixes that problem.
This commit is contained in:
Nikolas Garofil 2013-06-20 22:07:40 +02:00
parent 36189de425
commit 9d36db7138

View File

@ -63,8 +63,7 @@ namespace {
std::string strerror_r(int errnum)
{
char buf[100];
strerror_r(errnum, buf, sizeof buf);
return buf;
return strerror_r(errnum, buf, sizeof buf);
}
std::pair<int, int> pipe2(int flags)