Use tcdrain() to flush frames to raw socks

This commit is contained in:
XANTRONIX Development 2020-07-08 15:34:24 -04:00 committed by XANTRONIX Industrial
parent aa5fda4424
commit 3e99af64d1

View file

@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <termios.h>
#include <errno.h>
#include <patty/ax25.h>
@ -323,7 +324,14 @@ static int handle_promisc_frame(void *key,
int fd = (int)(value - NULL);
struct promisc_frame *frame = ctx;
return write(fd, frame->buf, frame->len);
if (write(fd, frame->buf, frame->len) < 0) {
goto error_write;
}
return tcdrain(fd);
error_write:
return -1;
}
ssize_t patty_ax25_if_recv(patty_ax25_if *iface,