diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6c6f482..c919cc1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,7 +34,7 @@ endif(WIN32) if(UNIX) add_library(discord-rpc ${RPC_LIBRARY_TYPE} ${BASE_RPC_SRC} connection_unix.cpp) target_link_libraries(discord-rpc PUBLIC pthread) - target_compile_options(discord-rpc PRIVATE -g -Wall) + target_compile_options(discord-rpc PRIVATE -g -Wall -std=c++14) endif(UNIX) target_include_directories(discord-rpc PRIVATE ${RAPIDJSON}/include) diff --git a/src/connection_unix.cpp b/src/connection_unix.cpp index cb9ff48..a201b60 100644 --- a/src/connection_unix.cpp +++ b/src/connection_unix.cpp @@ -60,7 +60,7 @@ bool BaseConnection::Open() fcntl(self->sock, F_SETFL, O_NONBLOCK); #ifdef SO_NOSIGPIPE int optval = 1; - setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval)); + setsockopt(self->sock, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval)); #endif for (int pipeNum = 0; pipeNum < 10; ++pipeNum) {