mirror of
git://sigrok.org/libserialport
synced 2023-08-10 21:13:24 +03:00
Fix building for Android.
This commit is contained in:
parent
397d89de3a
commit
33fd8804b8
@ -33,7 +33,7 @@
|
||||
* TCSETX/TCGETX ioctls used with struct termiox, others do not.
|
||||
*/
|
||||
|
||||
#ifdef __linux__
|
||||
#if defined(__linux__) && !defined(__ANDROID__)
|
||||
|
||||
#include <linux/termios.h>
|
||||
#include "linux_termios.h"
|
||||
|
@ -50,7 +50,9 @@
|
||||
#ifdef HAVE_LIBUDEV
|
||||
#include "libudev.h"
|
||||
#endif
|
||||
#ifndef __ANDROID__
|
||||
#include "linux/serial.h"
|
||||
#endif
|
||||
#include "linux_termios.h"
|
||||
|
||||
/* TCGETX/TCSETX is not available everywhere. */
|
||||
@ -815,7 +817,12 @@ enum sp_return sp_drain(struct sp_port *port)
|
||||
#else
|
||||
int result;
|
||||
while (1) {
|
||||
#ifdef __ANDROID__
|
||||
int arg = 1;
|
||||
result = ioctl(port->fd, TCSBRK, &arg);
|
||||
#else
|
||||
result = tcdrain(port->fd);
|
||||
#endif
|
||||
if (result < 0) {
|
||||
if (errno == EINTR) {
|
||||
DEBUG("tcdrain() was interrupted");
|
||||
|
Loading…
Reference in New Issue
Block a user