Applied serial-fixes from Huang Yushuo <huangys@xynetsoft.com>

Tested connection with ZOC and HyperTerm on Windows


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@754 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Michael Gernoth 2004-08-24 21:37:25 +00:00
parent 3dbf5279c8
commit 65a649565d
2 changed files with 6 additions and 2 deletions

View File

@ -940,7 +940,8 @@ rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out)
/* only delete link if all data has been transfered */ /* only delete link if all data has been transfered */
/* or if result was 0 and status success - EOF */ /* or if result was 0 and status success - EOF */
if ((iorq->partial_len == iorq->length) || if ((iorq->partial_len == iorq->length) ||
(result == 0)) (g_rdpdr_device[iorq->device].device_type ==
DEVICE_TYPE_SERIAL) || (result == 0))
{ {
#if WITH_DEBUG_RDP5 #if WITH_DEBUG_RDP5
DEBUG(("RDPDR: AIO total %u bytes read of %u\n", iorq->partial_len, iorq->length)); DEBUG(("RDPDR: AIO total %u bytes read of %u\n", iorq->partial_len, iorq->length));

View File

@ -374,7 +374,9 @@ serial_enum_devices(uint32 * id, char *optarg)
// Init data structures for device // Init data structures for device
pser_inf = (SERIAL_DEVICE *) xmalloc(sizeof(SERIAL_DEVICE)); pser_inf = (SERIAL_DEVICE *) xmalloc(sizeof(SERIAL_DEVICE));
pser_inf->ptermios = (struct termios *) xmalloc(sizeof(struct termios)); pser_inf->ptermios = (struct termios *) xmalloc(sizeof(struct termios));
memset(pser_inf->ptermios, 0, sizeof(struct termios));
pser_inf->pold_termios = (struct termios *) xmalloc(sizeof(struct termios)); pser_inf->pold_termios = (struct termios *) xmalloc(sizeof(struct termios));
memset(pser_inf->pold_termios, 0, sizeof(struct termios));
pos2 = next_arg(optarg, '='); pos2 = next_arg(optarg, '=');
strcpy(g_rdpdr_device[*id].name, optarg); strcpy(g_rdpdr_device[*id].name, optarg);
@ -406,7 +408,7 @@ serial_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposi
pser_inf = (SERIAL_DEVICE *) g_rdpdr_device[device_id].pdevice_data; pser_inf = (SERIAL_DEVICE *) g_rdpdr_device[device_id].pdevice_data;
ptermios = pser_inf->ptermios; ptermios = pser_inf->ptermios;
serial_fd = open(g_rdpdr_device[device_id].local_path, O_RDWR | O_NOCTTY); serial_fd = open(g_rdpdr_device[device_id].local_path, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (serial_fd == -1) if (serial_fd == -1)
{ {
@ -437,6 +439,7 @@ serial_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposi
tcsetattr(serial_fd, TCSANOW, ptermios); tcsetattr(serial_fd, TCSANOW, ptermios);
*/ */
cfmakeraw(pser_inf->ptermios);
*handle = serial_fd; *handle = serial_fd;
/* all read and writes should be non blocking */ /* all read and writes should be non blocking */