argument.
* fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto.
(fhandler_serial::open): Avoid else when previous clause is a return().
* path.cc (get_devn): Alias /dev/ttyS0 -> /dev/com1, etc.
(get_device_number): Reallow standalone "com1" as a valid name for /dev/com1.
+2001-10-29 Christopher Faylor <cgf@redhat.com>
+
+ * fhandler.h (fhandler_serial::fhandler_serial): Change to only accept
+ unit argument.
+ * fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto.
+ (fhandler_serial::open): Avoid else when previous clause is a return().
+ * path.cc (get_devn): Alias /dev/ttyS0 -> /dev/com1, etc.
+ (get_device_number): Reallow standalone "com1" as a valid name for
+ /dev/com1.
+
2001-10-26 Christopher Faylor <cgf@redhat.com>
* select.cc (MAKEready): Check for read_ready in loop since select_read
{
protected:
DWORD status;
-public:
private:
int access;
HANDLE io_handle;
OVERLAPPED io_status;
/* Constructor */
- fhandler_serial (DWORD devtype = FH_SERIAL, int unit = 0);
+ fhandler_serial (int unit);
int open (path_conv *, int flags, mode_t mode);
int close ();
/**********************************************************************/
/* fhandler_serial */
-fhandler_serial::fhandler_serial (DWORD devtype, int unit)
- : fhandler_base (devtype, unit), vmin_ (0), vtime_ (0), pgrp_ (myself->pgid)
+fhandler_serial::fhandler_serial (int unit)
+ : fhandler_base (FH_SERIAL, unit), vmin_ (0), vtime_ (0), pgrp_ (myself->pgid)
{
set_need_fork_fixup ();
}
if (!(res = this->fhandler_base::open (NULL, flags, mode)))
return 0;
- else
- res = 1;
+
+ res = 1;
(void) SetCommMask (get_handle (), EV_RXCHAR);
/**********************************************************************/
/* fhandler_socket */
-fhandler_socket::fhandler_socket () :
- fhandler_base (FH_SOCKET)
+fhandler_socket::fhandler_socket ()
+ : fhandler_base (FH_SOCKET)
{
set_need_fork_fixup ();
prot_info_ptr = (LPWSAPROTOCOL_INFOA) cmalloc (HEAP_BUF,
static DWORD WINAPI process_output (void *); // Output queue thread
static DWORD WINAPI process_ioctl (void *); // Ioctl requests thread
-fhandler_tty_master::fhandler_tty_master (int unit) :
- fhandler_pty_master (FH_TTYM, unit), console (NULL), hThread (NULL)
+fhandler_tty_master::fhandler_tty_master (int unit)
+ : fhandler_pty_master (FH_TTYM, unit), console (NULL), hThread (NULL)
{
}
else if (deveqn ("com", 3) && (unit = digits (name + 3)) >= 0)
devn = FH_SERIAL;
else if (deveqn ("ttyS", 4) && (unit = digits (name + 4)) >= 0)
- devn = FH_SERIAL;
+ {
+ devn = FH_SERIAL;
+ unit++;
+ }
else if (deveq ("pipe") || deveq ("piper") || deveq ("pipew"))
devn = FH_PIPE;
else if (deveq ("tcp") || deveq ("udp") || deveq ("streamsocket")
devn = get_devn (unix_path, unit);
if (devn == FH_BAD && *w32_path == '\\' && wdeveqn ("\\dev\\", 5))
devn = get_devn (w32_path, unit);
- if (devn == FH_BAD && udeveqn ("com", 3)
- && (unit = digits (unix_path + 3)) >= 0)
- devn = FH_SERIAL;
if (devn == FH_BAD && wdeveqn ("\\\\.\\", 4))
devn = get_raw_device_number (unix_path + 5, w32_path + 4, unit);
if (devn == FH_BAD)
devn = get_raw_device_number (unix_path + 5, NULL, unit);
}
+ else
+ {
+ char *p = strrchr (unix_path, '/');
+ if (p)
+ unix_path = p + 1;
+ if (udeveqn ("com", 3)
+ && (unit = digits (unix_path + 3)) >= 0)
+ devn = FH_SERIAL;
+ }
+
return devn;
}
static int
set_bits (select_record *me, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds)
+ fd_set *exceptfds)
{
int ready = 0;
select_printf ("me %p, testing fd %d (%s)", me, me->fd, me->fh->get_name ());