From 0b2702314ff98b48fd23052732ed649a3a7701c2 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 14 Jun 2016 06:36:40 +0100 Subject: [PATCH] Fix Linux compiler issues. --- YSFGateway/APRSWriter.cpp | 3 ++- YSFGateway/APRSWriterThread.cpp | 2 +- YSFGateway/Makefile | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/YSFGateway/APRSWriter.cpp b/YSFGateway/APRSWriter.cpp index a9b489d..1b6d91a 100644 --- a/YSFGateway/APRSWriter.cpp +++ b/YSFGateway/APRSWriter.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include CAPRSWriter::CAPRSWriter(const std::string& callsign, const std::string& suffix, const std::string& password, const std::string& address, unsigned int port) : @@ -199,7 +200,7 @@ void CAPRSWriter::sendIdFrames() ::strcpy(desc, "MMDVM Voice"); } - char* band; + const char* band; if (m_txFrequency >= 1200000000U) band = "1.2"; else if (m_txFrequency >= 420000000U) diff --git a/YSFGateway/APRSWriterThread.cpp b/YSFGateway/APRSWriterThread.cpp index b028a6f..93e2e48 100644 --- a/YSFGateway/APRSWriterThread.cpp +++ b/YSFGateway/APRSWriterThread.cpp @@ -226,7 +226,6 @@ bool CAPRSWriterThread::connect() m_socket.close(); return false; } - length = m_socket.readLine(serverResponse, APRS_TIMEOUT); if (length == 0) { @@ -234,6 +233,7 @@ bool CAPRSWriterThread::connect() m_socket.close(); return false; } + if (length < 0) { LogError("Error when reading from the APRS server"); m_socket.close(); diff --git a/YSFGateway/Makefile b/YSFGateway/Makefile index a48b5c0..50aca69 100644 --- a/YSFGateway/Makefile +++ b/YSFGateway/Makefile @@ -1,7 +1,7 @@ CC = gcc CXX = g++ CFLAGS = -g -O3 -Wall -std=c++0x -pthread -LIBS = -lpthread +LIBS = -lm -lpthread LDFLAGS = -g OBJECTS = APRSWriterThread.o APRSWriter.o Conf.o CRC.o Golay24128.o GPS.o Hosts.o Log.o Network.o Reflectors.o StopWatch.o Sync.o TCPSocket.o Thread.o Timer.o \