Commit Graph

7 Commits

Author SHA1 Message Date
Corinna Vinschen 5fea2f87dc Cygwin: fhandler: clean up 'copyto' logic
Analyzing the fhandler::copyto logic shows that the fhandler_base::reset
method was only called from copyto anyway.

Trying to convert reset to a protected method uncovered that the copyto
method is actually thought upside down from an object oriented POV.

Rather than calling copyto, manipulating the object given as parameter,
rename the method to copy_from, which manipulates the calling object
itself with data from the object given as parameter.

Eventually make reset a protected method and rename it to
_copy_from_reset_helper to clarify it's only called from copy_from.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-02-10 10:42:38 +01:00
Corinna Vinschen 5f0913df13 Cygwin: drop path_conv::reset_conv_handle
path_conv::reset_conv_handle is only called after fhandler::copyto
has been called.  This duplicated the path_conv_handle if there was
one, so just setting the conv handle to NULL potentially produces a
handle leak.  Replace reset_conv_handle calls with calls to
close_conv_handle and drop the reset_conv_handle method.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-02-10 10:42:38 +01:00
Takashi Yano a9c661a94d Cygwin: [gs]et_io_handle(): renamed to [gs]et_handle().
- Unify get_io_handle() and get_handle() to get_handle().
  Both of them returned same value; io_handle.
- Rename set_io_handle() to set_handle().
2019-03-30 20:08:36 +01:00
Corinna Vinschen 5628399c84 Cygwin: proc fd: fix handling of pipes, sockets, etc
The symlink target of /proc/PID/fd files pointing to pipes and
sockets are just artificial filenames referencing the object using
some internal number.  The pipe open code expects a path specifying
process pid and the internal number so it access the right process
and pipe.

- Set the posix path of the pipe to the simple pipe name only,
  as it shows up in /proc/PID/fd.  A /proc/self prefix is just
  as wrong as a /dev/fd prefix.

- Revert thinko in fhandler_pipe::open expecting the name as
  /proc/self/fd/...  In fact this should never happen.

- Fix up the path before re-opening the pipe instead.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2019-02-05 15:32:08 +01:00
Corinna Vinschen 3bfe18c643 Cygwin: fhandler_pipe: fix comment
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2019-01-19 20:04:35 +01:00
Corinna Vinschen d31f9f9c13 Cygwin: fhandler_pipe: unify format directives
The format directives in sscanf/__small_sprintf are not
matching.  Fix that.
2019-01-13 22:30:33 +01:00
Corinna Vinschen 91ca95ae4a Cygwin: rename pipe.cc to fhandler_pipe.cc
move pipe syscalls to syscalls.cc

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2019-01-07 12:31:28 +01:00