commit
bdb1c49bae
2
Makefile
2
Makefile
|
@ -3,7 +3,7 @@
|
||||||
CC = cc
|
CC = cc
|
||||||
CXX = c++
|
CXX = c++
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread
|
||||||
LIBS = -lpthread
|
LIBS = -lpthread -lutil
|
||||||
LDFLAGS = -g
|
LDFLAGS = -g
|
||||||
|
|
||||||
OBJECTS = AX25Control.o AX25Network.o \
|
OBJECTS = AX25Control.o AX25Network.o \
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#include <pty.h>
|
||||||
|
|
||||||
|
|
||||||
CPseudoTTYController::CPseudoTTYController(const std::string& device, unsigned int speed, bool assertRTS) :
|
CPseudoTTYController::CPseudoTTYController(const std::string& device, unsigned int speed, bool assertRTS) :
|
||||||
|
@ -48,9 +49,11 @@ bool CPseudoTTYController::open()
|
||||||
{
|
{
|
||||||
assert(m_fd == -1);
|
assert(m_fd == -1);
|
||||||
|
|
||||||
m_fd = ::posix_openpt(O_RDWR | O_NOCTTY | O_NDELAY);
|
int slavefd;
|
||||||
if (m_fd < 0) {
|
char buf[300];
|
||||||
LogError("Cannot open device - %s", m_device.c_str());
|
int result = ::openpty(&m_fd, &slavefd, buf, NULL,NULL);
|
||||||
|
if (result < 0) {
|
||||||
|
LogError("Cannot open device - %s - Errno : %d", m_device.c_str(), errno);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue