ipdbg-la: data_available(): Return gboolean.

This commit is contained in:
Uwe Hermann 2018-08-30 01:02:32 +02:00
parent 3831eaf9f4
commit 4465837b7d
2 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@
/* LA subfunction command opcodes */
#define CMD_LA_DELAY 0x1F
SR_PRIV int data_available(struct ipdbg_la_tcp *tcp)
SR_PRIV gboolean data_available(struct ipdbg_la_tcp *tcp)
{
#ifdef __WIN32__
ioctlsocket(tcp->socket, FIONREAD, &bytes_available);
@ -77,10 +77,10 @@ SR_PRIV int data_available(struct ipdbg_la_tcp *tcp)
if (ioctl(tcp->socket, FIONREAD, &status) < 0) { // TIOCMGET
sr_err("FIONREAD failed: %s\n", g_strerror(errno));
return 0;
return FALSE;
}
return (status < 1) ? 0 : 1;
return (status < 1) ? FALSE : TRUE;
#endif // __WIN32__
}

View File

@ -54,7 +54,7 @@ struct dev_context {
uint8_t *raw_sample_buf;
};
int data_available(struct ipdbg_la_tcp *tcp);
SR_PRIV gboolean data_available(struct ipdbg_la_tcp *tcp);
SR_PRIV struct ipdbg_la_tcp *ipdbg_la_tcp_new(void);
SR_PRIV void ipdbg_la_tcp_free(struct ipdbg_la_tcp *tcp);