diff options
author | Christopher Faylor <me@cgf.cx> | 2001-10-08 09:50:33 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-10-08 09:50:33 +0400 |
commit | 97405ef5b07997c805ebd2a6c3ecbe4440c92346 (patch) | |
tree | ab8b63cbc031a3deb5aa78c0c1403ad4c769ff93 /winsup/cygwin/fhandler.h | |
parent | 2c774ac3f368e61613be8af75eba028d820b5a4b (diff) |
* dtable.cc (dtable::build_fhandler): Allocate correct amount for given
fhandler class.
* fhandler.h (fhandler_union): Properly define rather than relying on
fhandler_console being "big enough".
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r-- | winsup/cygwin/fhandler.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 5a07c43c9..d1ebe0a7f 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -1019,18 +1019,31 @@ public: void fixup_after_exec (HANDLE); }; -#if 0 -/* You can't do this */ typedef union { - fhandler_normal normal; - fhandler_dev_null dev_null; - fhandler bare; - fhandler_serial tty; + char base[sizeof(fhandler_base)]; + char console[sizeof(fhandler_console)]; + char dev_clipboard[sizeof(fhandler_dev_clipboard)]; + char dev_dsp[sizeof(fhandler_dev_dsp)]; + char dev_floppy[sizeof(fhandler_dev_floppy)]; + char dev_mem[sizeof(fhandler_dev_mem)]; + char dev_null[sizeof(fhandler_dev_null)]; + char dev_random[sizeof(fhandler_dev_random)]; + char dev_raw[sizeof(fhandler_dev_raw)]; + char dev_tape[sizeof(fhandler_dev_tape)]; + char dev_zero[sizeof(fhandler_dev_zero)]; + char disk_file[sizeof(fhandler_disk_file)]; + char pipe[sizeof(fhandler_pipe)]; + char pty_master[sizeof(fhandler_pty_master)]; + char serial[sizeof(fhandler_serial)]; + char socket[sizeof(fhandler_socket)]; + char termios[sizeof(fhandler_termios)]; + char tty_common[sizeof(fhandler_tty_common)]; + char tty_master[sizeof(fhandler_tty_master)]; + char tty_slave[sizeof(fhandler_tty_slave)]; + char windows[sizeof(fhandler_windows)]; } fhandler_union; -#else -#define fhandler_union fhandler_console -#endif + struct select_record { int fd; |