diff options
-rw-r--r-- | winsup/cygwin/dtable.cc | 16 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 12 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.h | 9 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 26 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 16 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_fifo.cc | 12 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_pipe.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_process_fd.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_registry.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_socket_inet.cc | 10 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_socket_unix.cc | 16 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 28 | ||||
-rw-r--r-- | winsup/cygwin/mmap.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/select.cc | 8 |
14 files changed, 87 insertions, 86 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 86e0c71..636221a 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -647,7 +647,7 @@ build_fh_pc (path_conv& pc) else if ((fh->archetype = cygheap->fdtab.find_archetype (fh->dev ()))) { debug_printf ("found an archetype for %s(%d/%d) io_handle %p", fh->get_name (), fh->dev ().get_major (), fh->dev ().get_minor (), - fh->archetype->get_io_handle ()); + fh->archetype->get_handle ()); if (!fh->get_name ()) fh->set_name (fh->archetype->dev ().name ()); } @@ -688,7 +688,7 @@ dtable::dup_worker (fhandler_base *oldfh, int flags) else { if (!oldfh->archetype) - newfh->set_io_handle (NULL); + newfh->set_handle (NULL); newfh->pc.reset_conv_handle (); if (oldfh->dup (newfh, flags)) @@ -708,7 +708,7 @@ dtable::dup_worker (fhandler_base *oldfh, int flags) /* The O_CLOEXEC flag enforces close-on-exec behaviour. */ newfh->set_close_on_exec (!!(flags & O_CLOEXEC)); debug_printf ("duped '%s' old %p, new %p", oldfh->get_name (), - oldfh->get_io_handle (), newfh->get_io_handle ()); + oldfh->get_handle (), newfh->get_handle ()); } } return newfh; @@ -765,7 +765,7 @@ dtable::dup3 (int oldfd, int newfd, int flags) } debug_printf ("newfh->io_handle %p, oldfh->io_handle %p, new win32_name %p, old win32_name %p", - newfh->get_io_handle (), fds[oldfd]->get_io_handle (), newfh->get_win32_name (), fds[oldfd]->get_win32_name ()); + newfh->get_handle (), fds[oldfd]->get_handle (), newfh->get_win32_name (), fds[oldfd]->get_win32_name ()); if (!not_open (newfd)) close (newfd); @@ -891,12 +891,12 @@ dtable::fixup_after_exec () /* Close the handle if it's close-on-exec or if an error was detected (typically with opening a console in a gui app) by fixup_after_exec. */ - if (fh->close_on_exec () || (!fh->nohandle () && !fh->get_io_handle ())) + if (fh->close_on_exec () || (!fh->nohandle () && !fh->get_handle ())) fixup_close (i, fh); else if (fh->get_popen_pid ()) close (i); else if (i == 0) - SetStdHandle (std_consts[i], fh->get_io_handle ()); + SetStdHandle (std_consts[i], fh->get_handle ()); else if (i <= 2) SetStdHandle (std_consts[i], fh->get_output_handle ()); } @@ -913,7 +913,7 @@ dtable::fixup_after_fork (HANDLE parent) { debug_printf ("fd %d (%s)", i, fh->get_name ()); fh->fixup_after_fork (parent); - if (!fh->nohandle () && !fh->get_io_handle ()) + if (!fh->nohandle () && !fh->get_handle ()) { /* This should actually never happen but it's here to make sure we don't crash due to access of an unopened file handle. */ @@ -922,7 +922,7 @@ dtable::fixup_after_fork (HANDLE parent) } } if (i == 0) - SetStdHandle (std_consts[i], fh->get_io_handle ()); + SetStdHandle (std_consts[i], fh->get_handle ()); else if (i <= 2) SetStdHandle (std_consts[i], fh->get_output_handle ()); } diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 659435e..b0c9c50 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -461,7 +461,7 @@ fhandler_base::open_with_arch (int flags, mode_t mode) } else if (archetype) { - if (!archetype->get_io_handle ()) + if (!archetype->get_handle ()) { copyto (archetype); archetype_usecount (1); @@ -522,7 +522,7 @@ fhandler_base::open_null (int flags) __seterrno_from_nt_status (status); goto done; } - set_io_handle (fh); + set_handle (fh); set_flags (flags, pc.binmode ()); res = 1; set_open_status (); @@ -775,7 +775,7 @@ fhandler_base::open (int flags, mode_t mode) } } - set_io_handle (fh); + set_handle (fh); set_flags (flags, pc.binmode ()); res = 1; @@ -1298,7 +1298,7 @@ fhandler_base_overlapped::close () /* Cancelling seems to be necessary for cases where a reader is still executing when a signal handler performs a close. */ if (!writer) - CancelIo (get_io_handle ()); + CancelIo (get_handle ()); destroy_overlapped (); res = fhandler_base::close (); } @@ -1382,7 +1382,7 @@ fhandler_base::fstatvfs (struct statvfs *sfs) int fhandler_base::init (HANDLE f, DWORD a, mode_t bin) { - set_io_handle (f); + set_handle (f); access = a; a &= GENERIC_READ | GENERIC_WRITE; int flags = 0; @@ -1417,7 +1417,7 @@ fhandler_base::dup (fhandler_base *child, int) } VerifyHandle (nh); - child->set_io_handle (nh); + child->set_handle (nh); } return 0; } diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 21fec9e..b336eb6 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -227,7 +227,7 @@ class fhandler_base virtual ~fhandler_base (); /* Non-virtual simple accessor functions. */ - void set_io_handle (HANDLE x) { io_handle = x; } + void set_handle (HANDLE x) { io_handle = x; } dev_t& get_device () { return dev (); } _major_t get_major () { return dev ().get_major (); } @@ -430,9 +430,9 @@ public: /* Virtual accessor functions to hide the fact that some fd's have two handles. */ virtual HANDLE& get_handle () { return io_handle; } - virtual HANDLE& get_io_handle () { return io_handle; } - virtual HANDLE& get_io_handle_cyg () { return io_handle; } + virtual HANDLE& get_handle_cyg () { return io_handle; } virtual HANDLE& get_output_handle () { return io_handle; } + virtual HANDLE& get_output_handle_cyg () { return io_handle; } virtual HANDLE get_stat_handle () { return pc.handle () ?: io_handle; } virtual HANDLE get_echo_handle () const { return NULL; } virtual bool hit_eof () {return false;} @@ -1726,6 +1726,7 @@ class fhandler_termios: public fhandler_base need_fork_fixup (true); } HANDLE& get_output_handle () { return output_handle; } + HANDLE& get_output_handle_cyg () { return output_handle; } line_edit_status line_edit (const char *rptr, size_t nread, termios&, ssize_t *bytes_read = NULL); void set_output_handle (HANDLE h) { output_handle = h; } @@ -2109,7 +2110,7 @@ class fhandler_pty_master: public fhandler_pty_common public: HANDLE get_echo_handle () const { return echo_r; } - HANDLE& get_io_handle_cyg () { return io_handle_cyg; } + HANDLE& get_handle_cyg () { return io_handle_cyg; } /* Constructor */ fhandler_pty_master (int); diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 6a0d640..281c200 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -155,7 +155,7 @@ fhandler_console::set_unit () pc.file_attributes (FILE_ATTRIBUTE_NORMAL); else { - set_io_handle (NULL); + set_handle (NULL); set_output_handle (NULL); created = false; } @@ -298,7 +298,7 @@ fhandler_console::read (void *pv, size_t& buflen) { push_process_state process_state (PID_TTYIN); - HANDLE h = get_io_handle (); + HANDLE h = get_handle (); #define buf ((char *) pv) @@ -818,7 +818,7 @@ fhandler_console::open (int flags, mode_t) tcinit (false); - set_io_handle (NULL); + set_handle (NULL); set_output_handle (NULL); /* Open the input handle as handle_ */ @@ -831,7 +831,7 @@ fhandler_console::open (int flags, mode_t) __seterrno (); return 0; } - set_io_handle (h); + set_handle (h); h = CreateFileW (L"CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, &sec_none, @@ -856,11 +856,11 @@ fhandler_console::open (int flags, mode_t) set_open_status (); DWORD cflags; - if (GetConsoleMode (get_io_handle (), &cflags)) - SetConsoleMode (get_io_handle (), + if (GetConsoleMode (get_handle (), &cflags)) + SetConsoleMode (get_handle (), ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT | cflags); - debug_printf ("opened conin$ %p, conout$ %p", get_io_handle (), + debug_printf ("opened conin$ %p, conout$ %p", get_handle (), get_output_handle ()); return 1; @@ -878,7 +878,7 @@ fhandler_console::open_setup (int flags) int fhandler_console::close () { - CloseHandle (get_io_handle ()); + CloseHandle (get_handle ()); CloseHandle (get_output_handle ()); if (!have_execed) free_console (); @@ -948,7 +948,7 @@ fhandler_console::ioctl (unsigned int cmd, void *arg) DWORD n; int ret = 0; INPUT_RECORD inp[INREC_SIZE]; - if (!PeekConsoleInputW (get_io_handle (), inp, INREC_SIZE, &n)) + if (!PeekConsoleInputW (get_handle (), inp, INREC_SIZE, &n)) { set_errno (EINVAL); return -1; @@ -972,7 +972,7 @@ fhandler_console::tcflush (int queue) if (queue == TCIFLUSH || queue == TCIOFLUSH) { - if (!FlushConsoleInputBuffer (get_io_handle ())) + if (!FlushConsoleInputBuffer (get_handle ())) { __seterrno (); res = -1; @@ -1004,7 +1004,7 @@ fhandler_console::input_tcsetattr (int, struct termios const *t) DWORD oflags; - if (!GetConsoleMode (get_io_handle (), &oflags)) + if (!GetConsoleMode (get_handle (), &oflags)) oflags = 0; DWORD flags = 0; @@ -1050,7 +1050,7 @@ fhandler_console::input_tcsetattr (int, struct termios const *t) res = 0; else { - res = SetConsoleMode (get_io_handle (), flags) ? 0 : -1; + res = SetConsoleMode (get_handle (), flags) ? 0 : -1; if (res < 0) __seterrno (); syscall_printf ("%d = tcsetattr(,%p) enable flags %y, c_lflag %y iflag %y", @@ -1080,7 +1080,7 @@ fhandler_console::tcgetattr (struct termios *t) DWORD flags; - if (!GetConsoleMode (get_io_handle (), &flags)) + if (!GetConsoleMode (get_handle (), &flags)) { __seterrno (); res = -1; diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 1931927..84d8645 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -212,7 +212,7 @@ fhandler_base::fstat_by_nfs_ea (struct stat *buf) cyg_ldap cldap; bool ldap_open = false; - if (get_io_handle ()) + if (get_handle ()) { /* NFS stumbles over its own caching. If you write to the file, a subsequent fstat does not return the actual size of the file, @@ -220,8 +220,8 @@ fhandler_base::fstat_by_nfs_ea (struct stat *buf) access through another handle invalidates the caching within the NFS client. */ if (get_access () & GENERIC_WRITE) - FlushFileBuffers (get_io_handle ()); - pc.get_finfo (get_io_handle ()); + FlushFileBuffers (get_handle ()); + pc.get_finfo (get_handle ()); } buf->st_dev = nfs_attr->fsid; buf->st_ino = nfs_attr->fileid; @@ -291,7 +291,7 @@ fhandler_base::fstat_by_handle (struct stat *buf) /* If the file has been opened for other purposes than stat, we can't rely on the information stored in pc.fai. So we overwrite them here. */ - if (get_io_handle ()) + if (get_handle ()) { status = pc.get_finfo (h); if (!NT_SUCCESS (status)) @@ -386,7 +386,7 @@ fhandler_base::fstat_fs (struct stat *buf) nohandle (false); close_fs (); nohandle (no_handle); - set_io_handle (NULL); + set_handle (NULL); } if (res) res = fstat_by_name (buf); @@ -1465,7 +1465,7 @@ fhandler_base::open_fs (int flags, mode_t mode) /* The file info in pc is wrong at this point for newly created files. Refresh it before fetching any file info. */ if (new_file) - pc.get_finfo (get_io_handle ()); + pc.get_finfo (get_handle ()); if (pc.isgood_inode (pc.get_ino ())) ino = pc.get_ino (); @@ -2615,7 +2615,7 @@ fhandler_disk_file::fs_ioc_setflags (uint64_t flags) if (fh != get_handle ()) NtClose (fh); NtClose (get_handle ()); - set_io_handle (NULL); + set_handle (NULL); pc.get_wide_win32_path (path); cret = (flags & FS_ENCRYPT_FL) @@ -2630,7 +2630,7 @@ fhandler_disk_file::fs_ioc_setflags (uint64_t flags) __seterrno_from_nt_status (status); return -1; } - set_io_handle (fh); + set_handle (fh); if (!cret) { __seterrno (); diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 7847cca..68b9e77 100644 --- a/winsup/cygwin/fhandler_fifo.cc +++ b/winsup/cygwin/fhandler_fifo.cc @@ -266,7 +266,7 @@ fhandler_fifo::open_pipe () sharing = FILE_SHARE_READ | FILE_SHARE_WRITE; status = NtOpenFile (&ph, access, &attr, &io, sharing, 0); if (NT_SUCCESS (status)) - set_io_handle (ph); + set_handle (ph); return status; } @@ -293,7 +293,7 @@ fhandler_fifo::add_client () HANDLE ph = create_pipe_instance (first); if (!ph) goto errout; - fh->set_io_handle (ph); + fh->set_handle (ph); fh->set_flags (get_flags ()); if (fc.connect () < 0) { @@ -486,7 +486,7 @@ fhandler_fifo::open (int flags, mode_t) res = error_errno_set; goto out; } - set_io_handle (ph); + set_handle (ph); set_pipe_non_blocking (ph, true); if (!(fh = build_fh_dev (dev ()))) { @@ -494,7 +494,7 @@ fhandler_fifo::open (int flags, mode_t) res = error_errno_set; goto out; } - fh->set_io_handle (ph); + fh->set_handle (ph); fh->set_flags (flags); if (!(connect_evt = create_event ())) { @@ -604,8 +604,8 @@ out: CloseHandle (write_ready); write_ready = NULL; } - if (get_io_handle ()) - CloseHandle (get_io_handle ()); + if (get_handle ()) + CloseHandle (get_handle ()); if (listen_client_thr) CloseHandle (listen_client_thr); } diff --git a/winsup/cygwin/fhandler_pipe.cc b/winsup/cygwin/fhandler_pipe.cc index 31e73ce..edbaded 100644 --- a/winsup/cygwin/fhandler_pipe.cc +++ b/winsup/cygwin/fhandler_pipe.cc @@ -97,7 +97,7 @@ fhandler_pipe::open (int flags, mode_t mode) || (rwflags == O_WRONLY && !(cfd->get_access () & GENERIC_WRITE))) continue; cfd->copyto (this); - set_io_handle (NULL); + set_handle (NULL); pc.reset_conv_handle (); if (!cfd->dup (this, flags)) return 1; diff --git a/winsup/cygwin/fhandler_process_fd.cc b/winsup/cygwin/fhandler_process_fd.cc index 3bf8b74..71ba8b6 100644 --- a/winsup/cygwin/fhandler_process_fd.cc +++ b/winsup/cygwin/fhandler_process_fd.cc @@ -116,7 +116,7 @@ fhandler_process_fd::fd_reopen (int flags, mode_t mode) fh = fetch_fh (hdl, 0); if (!fh) return NULL; - fh->set_io_handle (hdl); + fh->set_handle (hdl); int ret = fh->open_with_arch (flags, mode); CloseHandle (hdl); if (!ret) @@ -139,7 +139,7 @@ fhandler_process_fd::fstat (struct stat *statbuf) fh = fetch_fh (hdl, 0); if (!fh) return -1; - fh->set_io_handle (hdl); + fh->set_handle (hdl); int ret = fh->fstat (statbuf); CloseHandle (hdl); delete fh; @@ -155,7 +155,7 @@ fhandler_process_fd::link (const char *newpath) fh = fetch_fh (hdl, FFH_LINKAT); if (!fh) return -1; - fh->set_io_handle (hdl); + fh->set_handle (hdl); int ret = fh->link (newpath); CloseHandle (hdl); delete fh; diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc index 6c6702a..ecaed08 100644 --- a/winsup/cygwin/fhandler_registry.cc +++ b/winsup/cygwin/fhandler_registry.cc @@ -826,7 +826,7 @@ fhandler_registry::open (int flags, mode_t mode) } else { - set_io_handle (fetch_hkey (i)); + set_handle (fetch_hkey (i)); /* Marking as nohandle allows to call dup on pseudo registry handles. */ if (get_handle () >= HKEY_CLASSES_ROOT) @@ -881,7 +881,7 @@ fhandler_registry::open (int flags, mode_t mode) else flags |= O_DIROPEN; - set_io_handle (handle); + set_handle (handle); set_close_on_exec (!!(flags & O_CLOEXEC)); value_name = cwcsdup (dec_file); @@ -1118,7 +1118,7 @@ fhandler_registry::dup (fhandler_base *child, int flags) allows fhandler_base::dup to succeed as usual for nohandle fhandlers. Here we just have to fix up by copying the pseudo handle value. */ if ((HKEY) get_handle () >= HKEY_CLASSES_ROOT) - fhs->set_io_handle (get_handle ()); + fhs->set_handle (get_handle ()); if (value_name) fhs->value_name = cwcsdup (value_name); return ret; diff --git a/winsup/cygwin/fhandler_socket_inet.cc b/winsup/cygwin/fhandler_socket_inet.cc index dbfbcf5..46af1c4 100644 --- a/winsup/cygwin/fhandler_socket_inet.cc +++ b/winsup/cygwin/fhandler_socket_inet.cc @@ -518,14 +518,14 @@ fhandler_socket_wsock::fixup_after_fork (HANDLE parent) if (new_sock == INVALID_SOCKET) { set_winsock_errno (); - set_io_handle ((HANDLE) INVALID_SOCKET); + set_handle ((HANDLE) INVALID_SOCKET); } else { /* Even though the original socket was not inheritable, the duplicated socket is potentially inheritable again. */ SetHandleInformation ((HANDLE) new_sock, HANDLE_FLAG_INHERIT, 0); - set_io_handle ((HANDLE) new_sock); + set_handle ((HANDLE) new_sock); debug_printf ("WSASocket succeeded (%p)", new_sock); } } @@ -571,13 +571,13 @@ fhandler_socket_wsock::dup (fhandler_base *child, int flags) cygheap->user.deimpersonate (); fhs->init_fixup_before (); - fhs->set_io_handle (get_io_handle ()); + fhs->set_handle (get_handle ()); int ret = fhs->fixup_before_fork_exec (GetCurrentProcessId ()); cygheap->user.reimpersonate (); if (!ret) { fhs->fixup_after_fork (GetCurrentProcess ()); - if (fhs->get_io_handle() != (HANDLE) INVALID_SOCKET) + if (fhs->get_handle() != (HANDLE) INVALID_SOCKET) return 0; } cygheap->fdtab.dec_need_fixup_before (); @@ -645,7 +645,7 @@ fhandler_socket_wsock::set_socket_handle (SOCKET sock, int af, int type, } } } - set_io_handle ((HANDLE) sock); + set_handle ((HANDLE) sock); set_addr_family (af); set_socket_type (type); if (!init_events ()) diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc index e71d2a7..eea7e76 100644 --- a/winsup/cygwin/fhandler_socket_unix.cc +++ b/winsup/cygwin/fhandler_socket_unix.cc @@ -938,7 +938,7 @@ fhandler_socket_unix::open_pipe (PUNICODE_STRING pipe_name, bool xchg_sock_info) status = NtOpenFile (&ph, access, &attr, &io, sharing, 0); if (NT_SUCCESS (status)) { - set_io_handle (ph); + set_handle (ph); if (xchg_sock_info) send_sock_info (false); } @@ -1365,7 +1365,7 @@ fhandler_socket_unix::socket (int af, int type, int protocol, int flags) if (flags & SOCK_CLOEXEC) set_close_on_exec (true); init_cred (); - set_io_handle (NULL); + set_handle (NULL); set_unique_id (); set_ino (get_unique_id ()); return 0; @@ -1412,7 +1412,7 @@ fhandler_socket_unix::socketpair (int af, int type, int protocol, int flags, pipe = create_pipe (true); if (!pipe) goto create_pipe_failed; - set_io_handle (pipe); + set_handle (pipe); sun_path (&sun); fh->peer_sun_path (&sun); connect_state (listener); @@ -1483,12 +1483,12 @@ fhandler_socket_unix::bind (const struct sockaddr *name, int namelen) binding_state (unbound); return -1; } - set_io_handle (pipe); + set_handle (pipe); } backing_file_handle = unnamed ? autobind (&sun) : create_file (&sun); if (!backing_file_handle) { - set_io_handle (NULL); + set_handle (NULL); if (pipe) NtClose (pipe); binding_state (unbound); @@ -1538,7 +1538,7 @@ fhandler_socket_unix::listen (int backlog) connect_state (unconnected); return -1; } - set_io_handle (pipe); + set_handle (pipe); state_lock (); set_cred (); state_unlock (); @@ -1575,7 +1575,7 @@ fhandler_socket_unix::accept4 (struct sockaddr *peer, int *len, int flags) else { /* Set new io handle. */ - set_io_handle (new_inst); + set_handle (new_inst); io_unlock (); /* Prepare new file descriptor. */ cygheap_fdnew fd; @@ -1600,7 +1600,7 @@ fhandler_socket_unix::accept4 (struct sockaddr *peer, int *len, int flags) sock->pc.set_nt_native_path (pc.get_nt_native_path ()); sock->connect_state (connected); sock->binding_state (binding_state ()); - sock->set_io_handle (accepted); + sock->set_handle (accepted); sock->sun_path (sun_path ()); sock->sock_cred (sock_cred ()); diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 7fe46eb..312c2d0 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -235,7 +235,7 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on /* Check echo pipe first. */ if (::bytes_available (echo_cnt, echo_r) && echo_cnt > 0) break; - if (!::bytes_available (n, get_io_handle_cyg ())) + if (!::bytes_available (n, get_handle_cyg ())) goto err; if (n) break; @@ -296,7 +296,7 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on goto err; } } - else if (!ReadFile (get_io_handle_cyg (), outbuf, rlen, &n, NULL)) + else if (!ReadFile (get_handle_cyg (), outbuf, rlen, &n, NULL)) { termios_printf ("ReadFile failed, %E"); goto err; @@ -494,7 +494,7 @@ fhandler_pty_slave::open (int flags, mode_t) termios_printf ("duplicated to_master_cyg %p->%p from pty_owner", get_ttyp ()->to_master_cyg (), to_master_cyg_local); - set_io_handle (from_master_local); + set_handle (from_master_local); set_output_handle (to_master_local); set_output_handle_cyg (to_master_cyg_local); @@ -1347,11 +1347,11 @@ fhandler_pty_master::close () if (!ForceCloseHandle (to_master)) termios_printf ("error closing to_master %p, %E", to_master); from_master = to_master = NULL; - if (!ForceCloseHandle (get_io_handle_cyg ())) - termios_printf ("error closing io_handle_cyg %p, %E", get_io_handle_cyg ()); + if (!ForceCloseHandle (get_handle_cyg ())) + termios_printf ("error closing io_handle_cyg %p, %E", get_handle_cyg ()); if (!ForceCloseHandle (to_master_cyg)) termios_printf ("error closing to_master_cyg %p, %E", to_master_cyg); - get_io_handle_cyg () = to_master_cyg = NULL; + get_handle_cyg () = to_master_cyg = NULL; ForceCloseHandle (echo_r); ForceCloseHandle (echo_w); echo_r = echo_w = NULL; @@ -1458,7 +1458,7 @@ fhandler_pty_master::ioctl (unsigned int cmd, void *arg) case FIONREAD: { DWORD n; - if (!::bytes_available (n, get_io_handle_cyg ())) + if (!::bytes_available (n, get_handle_cyg ())) { set_errno (EINVAL); return -1; @@ -1662,7 +1662,7 @@ fhandler_pty_master::pty_master_fwd_thread () termios_printf("Started."); for (;;) { - if (!ReadFile (get_io_handle (), outbuf, sizeof outbuf, &rlen, NULL)) + if (!ReadFile (get_handle (), outbuf, sizeof outbuf, &rlen, NULL)) { termios_printf ("ReadFile for forwarding failed, %E"); break; @@ -1715,7 +1715,7 @@ fhandler_pty_master::setup () char pipename[sizeof("ptyNNNN-to-master-cyg")]; __small_sprintf (pipename, "pty%d-to-master", unit); - res = fhandler_pipe::create (&sec_none, &get_io_handle (), &to_master, + res = fhandler_pipe::create (&sec_none, &get_handle (), &to_master, fhandler_pty_common::pipesize, pipename, 0); if (res) { @@ -1724,7 +1724,7 @@ fhandler_pty_master::setup () } __small_sprintf (pipename, "pty%d-to-master-cyg", unit); - res = fhandler_pipe::create (&sec_none, &get_io_handle_cyg (), &to_master_cyg, + res = fhandler_pipe::create (&sec_none, &get_handle_cyg (), &to_master_cyg, fhandler_pty_common::pipesize, pipename, 0); if (res) { @@ -1732,7 +1732,7 @@ fhandler_pty_master::setup () goto err; } - ProtectHandle1 (get_io_handle (), from_pty); + ProtectHandle1 (get_handle (), from_pty); __small_sprintf (pipename, "pty%d-echoloop", unit); res = fhandler_pipe::create (&sec_none, &echo_r, &echo_w, @@ -1807,14 +1807,14 @@ fhandler_pty_master::setup () dev ().parse (DEV_PTYM_MAJOR, unit); termios_printf ("this %p, pty%d opened - from_pty <%p,%p>, to_pty %p", - this, unit, get_io_handle (), get_io_handle_cyg (), + this, unit, get_handle (), get_handle_cyg (), get_output_handle ()); return true; err: __seterrno (); - close_maybe (get_io_handle ()); - close_maybe (get_io_handle_cyg ()); + close_maybe (get_handle ()); + close_maybe (get_handle_cyg ()); close_maybe (get_output_handle ()); close_maybe (input_available_event); close_maybe (output_mutex); diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 1d81d53..9eb1643 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -516,7 +516,7 @@ mmap_record::alloc_fh () { if (anonymous ()) { - fh_anonymous.set_io_handle (INVALID_HANDLE_VALUE); + fh_anonymous.set_handle (INVALID_HANDLE_VALUE); fh_anonymous.set_access (GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE); return &fh_anonymous; } @@ -901,7 +901,7 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, off_t off) size_t pagesize = wincap.allocation_granularity (); - fh_anonymous.set_io_handle (INVALID_HANDLE_VALUE); + fh_anonymous.set_handle (INVALID_HANDLE_VALUE); fh_anonymous.set_access (GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE); /* EINVAL error conditions. */ @@ -1033,7 +1033,7 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, off_t off) fh_disk_file = new (ccalloc (HEAP_FHANDLER, 1, sizeof *fh_disk_file)) fhandler_disk_file; fh_disk_file->set_name (fh->pc); - fh_disk_file->set_io_handle (h); + fh_disk_file->set_handle (h); fh_disk_file->set_access (fh->get_access () | GENERIC_EXECUTE); fh = fh_disk_file; } diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 991494a..9b18e8f 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -74,7 +74,7 @@ details. */ }) #define set_handle_or_return_if_not_open(h, s) \ - h = (s)->fh->get_io_handle_cyg (); \ + h = (s)->fh->get_handle_cyg (); \ if (cygheap->fdtab.not_open ((s)->fd)) \ { \ (s)->thread_errno = EBADF; \ @@ -1459,7 +1459,7 @@ fhandler_base::select_read (select_stuff *ss) s->startup = no_startup; s->verify = verify_ok; } - s->h = get_io_handle_cyg (); + s->h = get_handle_cyg (); s->read_selected = true; s->read_ready = true; return s; @@ -1474,7 +1474,7 @@ fhandler_base::select_write (select_stuff *ss) s->startup = no_startup; s->verify = verify_ok; } - s->h = get_handle (); + s->h = get_output_handle_cyg (); s->write_selected = true; s->write_ready = true; return s; @@ -1747,7 +1747,7 @@ fhandler_socket_unix::select_read (select_stuff *ss) s->startup = no_startup; s->verify = verify_ok; } - s->h = get_io_handle_cyg (); + s->h = get_handle_cyg (); s->read_selected = true; s->read_ready = true; return s; |