fix compilation on cygwin

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@811 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Jeroen Meijer 2005-02-14 00:34:23 +00:00
parent ab4e3fdb48
commit f0bc70c24e
2 changed files with 15 additions and 10 deletions

3
disk.c
View File

@ -18,6 +18,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include "rdesktop.h"
#include "disk.h" #include "disk.h"
#include <sys/types.h> #include <sys/types.h>
@ -82,8 +83,6 @@
#define F_NAMELEN(buf) ((buf).f_namelen) #define F_NAMELEN(buf) ((buf).f_namelen)
#endif #endif
#include "rdesktop.h"
extern RDPDR_DEVICE g_rdpdr_device[]; extern RDPDR_DEVICE g_rdpdr_device[];
FILEINFO g_fileinfo[MAX_OPEN_FILES]; FILEINFO g_fileinfo[MAX_OPEN_FILES];

View File

@ -121,10 +121,10 @@
/* FIONREAD should really do the same thing as TIOCINQ, where it is /* FIONREAD should really do the same thing as TIOCINQ, where it is
* not available */ * not available */
#ifndef TIOCINQ #if !defined(TIOCINQ) && defined(FIONREAD)
#define TIOCINQ FIONREAD #define TIOCINQ FIONREAD
#endif #endif
#ifndef TIOCOUTQ #if !defined(TIOCOUTQ) && defined(FIONWRITE)
#define TIOCOUTQ FIONWRITE #define TIOCOUTQ FIONWRITE
#endif #endif
@ -646,7 +646,7 @@ serial_read(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32
} }
tcsetattr(handle, TCSANOW, ptermios); tcsetattr(handle, TCSANOW, ptermios);
#ifdef WITH_DEBUG_SERIAL #if defined(WITH_DEBUG_SERIAL) && defined(TIOCINQ)
ioctl(handle, TIOCINQ, &bytes_inqueue); ioctl(handle, TIOCINQ, &bytes_inqueue);
DEBUG_SERIAL(("serial_read inqueue: %d expected %d\n", bytes_inqueue, length)); DEBUG_SERIAL(("serial_read inqueue: %d expected %d\n", bytes_inqueue, length));
#endif #endif
@ -794,7 +794,8 @@ serial_device_control(NTHANDLE handle, uint32 request, STREAM in, STREAM out)
break; break;
case SERIAL_GET_WAIT_MASK: case SERIAL_GET_WAIT_MASK:
DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_WAIT_MASK %X\n", DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_WAIT_MASK %X\n",
pser_inf->wait_mask); out_uint32(out, pser_inf->wait_mask)); pser_inf->wait_mask);
out_uint32(out, pser_inf->wait_mask));
break; break;
case SERIAL_SET_WAIT_MASK: case SERIAL_SET_WAIT_MASK:
in_uint32(in, pser_inf->wait_mask); in_uint32(in, pser_inf->wait_mask);
@ -854,14 +855,18 @@ serial_device_control(NTHANDLE handle, uint32 request, STREAM in, STREAM out)
out_uint32_le(out, 0); /* Hold reasons */ out_uint32_le(out, 0); /* Hold reasons */
result = 0; result = 0;
#ifdef TIOCINQ
ioctl(handle, TIOCINQ, &result); ioctl(handle, TIOCINQ, &result);
#endif
out_uint32_le(out, result); /* Amount in in queue */ out_uint32_le(out, result); /* Amount in in queue */
if (result) if (result)
DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_COMMSTATUS in queue %d\n", DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_COMMSTATUS in queue %d\n",
result)); result));
result = 0; result = 0;
#ifdef TIOCOUTQ
ioctl(handle, TIOCOUTQ, &result); ioctl(handle, TIOCOUTQ, &result);
#endif
out_uint32_le(out, result); /* Amount in out queue */ out_uint32_le(out, result); /* Amount in out queue */
if (result) if (result)
DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_COMMSTATUS out queue %d\n", result)); DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_COMMSTATUS out queue %d\n", result));
@ -934,9 +939,9 @@ serial_get_event(NTHANDLE handle, uint32 * result)
if (index < 0) if (index < 0)
return False; return False;
#ifdef TIOCINQ
pser_inf = (SERIAL_DEVICE *) g_rdpdr_device[index].pdevice_data; pser_inf = (SERIAL_DEVICE *) g_rdpdr_device[index].pdevice_data;
ioctl(handle, TIOCINQ, &bytes); ioctl(handle, TIOCINQ, &bytes);
if (bytes > 0) if (bytes > 0)
@ -972,8 +977,9 @@ serial_get_event(NTHANDLE handle, uint32 * result)
{ {
pser_inf->event_rlsd = 0; pser_inf->event_rlsd = 0;
} }
#endif
#ifdef TIOCOUTQ
ioctl(handle, TIOCOUTQ, &bytes); ioctl(handle, TIOCOUTQ, &bytes);
if ((bytes == 0) if ((bytes == 0)
&& (pser_inf->event_txempty > 0) && (pser_inf->wait_mask & SERIAL_EV_TXEMPTY)) && (pser_inf->event_txempty > 0) && (pser_inf->wait_mask & SERIAL_EV_TXEMPTY))
@ -984,7 +990,7 @@ serial_get_event(NTHANDLE handle, uint32 * result)
ret = True; ret = True;
} }
pser_inf->event_txempty = bytes; pser_inf->event_txempty = bytes;
#endif
ioctl(handle, TIOCMGET, &bytes); ioctl(handle, TIOCMGET, &bytes);
if ((bytes & TIOCM_DSR) != pser_inf->event_dsr) if ((bytes & TIOCM_DSR) != pser_inf->event_dsr)