1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00

Fix compilation in gcc

This commit is contained in:
Carles Fernandez 2017-05-12 19:40:51 +02:00
parent c804fb8d6f
commit 44ba718de4

View File

@ -58,11 +58,9 @@
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#define __USE_MISC
#include <errno.h> #include <errno.h>
#include <termios.h> #include <termios.h>
#include <sys/socket.h> #include <sys/socket.h>
//#include <netinet/in.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
@ -101,7 +99,7 @@ serial_t *openserial(const char *path, int mode, char *msg)
if (!(serial = (serial_t *)malloc(sizeof(serial_t)))) return NULL; if (!(serial = (serial_t *)malloc(sizeof(serial_t)))) return NULL;
if ((p = strchr(path, ':'))) if ((p = strchr((char*)path, ':')))
{ {
strncpy(port, path, p-path); port[p-path] = '\0'; strncpy(port, path, p-path); port[p-path] = '\0';
sscanf(p, ":%d:%d:%c:%d:%s", &brate, &bsize, &parity, &stopb, fctr); sscanf(p, ":%d:%d:%c:%d:%s", &brate, &bsize, &parity, &stopb, fctr);
@ -953,7 +951,7 @@ int consock(tcpcli_t *tcpcli, char *msg)
tracet(3, "consock: sock=%d\n", tcpcli->svr.sock); tracet(3, "consock: sock=%d\n", tcpcli->svr.sock);
/* wait re-connect */ /* wait re-connect */
if (tcpcli->svr.tcon < 0 || (tcpcli->svr.tcon>0 && if (tcpcli->svr.tcon < 0 || (tcpcli->svr.tcon > 0 &&
(int)(tickget()-tcpcli->svr.tdis) < tcpcli->svr.tcon)) (int)(tickget()-tcpcli->svr.tdis) < tcpcli->svr.tcon))
{ {
return 0; return 0;