Use tcdrain() to flush frames to raw socks
This commit is contained in:
parent
aa5fda4424
commit
3e99af64d1
1 changed files with 9 additions and 1 deletions
10
src/if.c
10
src/if.c
|
@ -2,6 +2,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <termios.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <patty/ax25.h>
|
#include <patty/ax25.h>
|
||||||
|
@ -323,7 +324,14 @@ static int handle_promisc_frame(void *key,
|
||||||
int fd = (int)(value - NULL);
|
int fd = (int)(value - NULL);
|
||||||
struct promisc_frame *frame = ctx;
|
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,
|
ssize_t patty_ax25_if_recv(patty_ax25_if *iface,
|
||||||
|
|
Loading…
Add table
Reference in a new issue