public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: fhandler_pipe: derive from fhandler_base
Date: Tue, 14 Sep 2021 15:04:38 +0000 (GMT)	[thread overview]
Message-ID: <20210914150438.D6BC23858402@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=72e083c4a01ef5c2bb51a7c05be315d249e442d1

commit 72e083c4a01ef5c2bb51a7c05be315d249e442d1
Author: Ken Brown <kbrown@cornell.edu>
Date:   Thu Aug 26 16:57:21 2021 -0400

    Cygwin: fhandler_pipe: derive from fhandler_base
    
    Previously fhandler_pipe was derived from fhandler_base_overlapped,
    which we are going to remove in a future commit.  Make minimal changes
    so that the build still succeeds.

Diff:
---
 winsup/cygwin/fhandler.h       |  5 ++---
 winsup/cygwin/fhandler_pipe.cc | 11 +++++------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 7c3cf8103..c612a3684 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -1238,14 +1238,14 @@ public:
   friend DWORD WINAPI flush_async_io (void *);
 };
 
-class fhandler_pipe: public fhandler_base_overlapped
+class fhandler_pipe: public fhandler_base
 {
 private:
   pid_t popen_pid;
+  size_t max_atomic_write;
 public:
   fhandler_pipe ();
 
-
   bool ispipe() const { return true; }
 
   void set_popen_pid (pid_t pid) {popen_pid = pid;}
@@ -1272,7 +1272,6 @@ public:
   {
     pc.free_strings ();
     *this = *reinterpret_cast<fhandler_pipe *> (x);
-    atomic_write_buf = NULL;
     _copy_from_reset_helper ();
   }
 
diff --git a/winsup/cygwin/fhandler_pipe.cc b/winsup/cygwin/fhandler_pipe.cc
index 7ab73a9d3..65ef70c25 100644
--- a/winsup/cygwin/fhandler_pipe.cc
+++ b/winsup/cygwin/fhandler_pipe.cc
@@ -21,7 +21,7 @@ details. */
 #include "shared_info.h"
 
 fhandler_pipe::fhandler_pipe ()
-  : fhandler_base_overlapped (), popen_pid (0)
+  : fhandler_base (), popen_pid (0)
 {
   max_atomic_write = DEFAULT_PIPEBUFSIZE;
   need_fork_fixup (true);
@@ -54,9 +54,8 @@ fhandler_pipe::init (HANDLE f, DWORD a, mode_t mode, int64_t uniq_id)
   set_ino (uniq_id);
   set_unique_id (uniq_id | !!(mode & GENERIC_WRITE));
   if (opened_properly)
-    setup_overlapped ();
-  else
-    destroy_overlapped ();
+    /* ... */
+    ;
   return 1;
 }
 
@@ -192,7 +191,7 @@ fhandler_pipe::dup (fhandler_base *child, int flags)
   ftp->set_popen_pid (0);
 
   int res;
-  if (get_handle () && fhandler_base_overlapped::dup (child, flags))
+  if (get_handle () && fhandler_base::dup (child, flags))
     res = -1;
   else
     res = 0;
@@ -359,7 +358,7 @@ fhandler_pipe::create (fhandler_pipe *fhs[2], unsigned psize, int mode)
   int res = -1;
   int64_t unique_id;
 
-  int ret = create (sa, &r, &w, psize, NULL, FILE_FLAG_OVERLAPPED, &unique_id);
+  int ret = create (sa, &r, &w, psize, NULL, 0, &unique_id);
   if (ret)
     __seterrno_from_win_error (ret);
   else if ((fhs[0] = (fhandler_pipe *) build_fh_dev (*piper_dev)) == NULL)


                 reply	other threads:[~2021-09-14 15:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210914150438.D6BC23858402@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).