diff options
author | RALOVICH, Kristof <tade60@freemail.hu> | 2014-01-19 19:56:34 +0100 |
---|---|---|
committer | RALOVICH, Kristof <tade60@freemail.hu> | 2014-01-19 19:56:34 +0100 |
commit | a22ee1ffec5486059c41929a20c2da3424fcafc6 (patch) | |
tree | af0d2e2974e1f6f962ec2c3d1f71d5483c513c9e | |
parent | 18a33fdf8a3a321b737c985b153377ed481680d1 (diff) |
use gnu variant of strerror_r
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/SerialTty.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d0e1800..50842e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,7 +38,7 @@ IF(MSVC) ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -fms-extensions -std=c++0x -Wall -D_XOPEN_SOURCE=600")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -fms-extensions -std=c++0x -Wall")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g3 -ggdb3")
diff --git a/src/SerialTty.cpp b/src/SerialTty.cpp index 38c3484..f796866 100644 --- a/src/SerialTty.cpp +++ b/src/SerialTty.cpp @@ -280,11 +280,11 @@ SerialTty::open() if(m_p->m_fd<0) { char se[256]; - int r = strerror_r(m_p->m_fd, se, sizeof(se)); + char* ss = strerror_r(m_p->m_fd, se, sizeof(se)); LOG(antpm::LOG_ERR) << "Opening serial port failed! Make sure cp210x kernel module is loaded, and /dev/ttyUSBxxx was created by cp210x!\n" << "\tAlso make sure that /dev/ttyUSBxxx is R+W accessible by your user (usually enabled through udev.rules)!\n"; - LOG(antpm::LOG_ERR) << "error=" << m_p->m_fd << ", strerror=" << se << "\n"; - return rv && (r==0); + LOG(antpm::LOG_ERR) << "error=" << m_p->m_fd << ", strerror=" << ss << "\n"; + return rv; } //printf("m_fd=%d\n", m_fd); |