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.
|
* 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>
|
||||||
#include "linux_termios.h"
|
#include "linux_termios.h"
|
||||||
|
@ -50,7 +50,9 @@
|
|||||||
#ifdef HAVE_LIBUDEV
|
#ifdef HAVE_LIBUDEV
|
||||||
#include "libudev.h"
|
#include "libudev.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef __ANDROID__
|
||||||
#include "linux/serial.h"
|
#include "linux/serial.h"
|
||||||
|
#endif
|
||||||
#include "linux_termios.h"
|
#include "linux_termios.h"
|
||||||
|
|
||||||
/* TCGETX/TCSETX is not available everywhere. */
|
/* TCGETX/TCSETX is not available everywhere. */
|
||||||
@ -815,7 +817,12 @@ enum sp_return sp_drain(struct sp_port *port)
|
|||||||
#else
|
#else
|
||||||
int result;
|
int result;
|
||||||
while (1) {
|
while (1) {
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
int arg = 1;
|
||||||
|
result = ioctl(port->fd, TCSBRK, &arg);
|
||||||
|
#else
|
||||||
result = tcdrain(port->fd);
|
result = tcdrain(port->fd);
|
||||||
|
#endif
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
if (errno == EINTR) {
|
if (errno == EINTR) {
|
||||||
DEBUG("tcdrain() was interrupted");
|
DEBUG("tcdrain() was interrupted");
|
||||||
|
Loading…
Reference in New Issue
Block a user