public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Cygwin: Make native clipboard layout same for 32- and 64-bit
Date: Fri, 8 Oct 2021 18:52:10 +0900	[thread overview]
Message-ID: <20211008185210.cac713f28dea727a1467cf94@nifty.ne.jp> (raw)
In-Reply-To: <20211007052237.7139-1-mark@maxrnd.com>

How about simply just:

diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_clipboard.cc
index ccdb295f3..d822f4fc4 100644
--- a/winsup/cygwin/fhandler_clipboard.cc
+++ b/winsup/cygwin/fhandler_clipboard.cc
@@ -28,9 +28,10 @@ static const WCHAR *CYGWIN_NATIVE = L"CYGWIN_NATIVE_CLIPBOARD";
 
 typedef struct
 {
-  timestruc_t	timestamp;
-  size_t	len;
-  char		data[1];
+  uint64_t tv_sec;
+  uint64_t tv_nsec;
+  uint64_t len;
+  char data[1];
 } cygcb_t;
 
 fhandler_dev_clipboard::fhandler_dev_clipboard ()
@@ -74,7 +75,10 @@ fhandler_dev_clipboard::set_clipboard (const void *buf, size_t len)
 	}
       clipbuf = (cygcb_t *) GlobalLock (hmem);
 
-      clock_gettime (CLOCK_REALTIME, &clipbuf->timestamp);
+      struct timespec ts;
+      clock_gettime (CLOCK_REALTIME, &ts);
+      clipbuf->tv_sec = ts.tv_sec;
+      clipbuf->tv_nsec = ts.tv_nsec;
       clipbuf->len = len;
       memcpy (clipbuf->data, buf, len);
 
@@ -179,7 +183,10 @@ fhandler_dev_clipboard::fstat (struct stat *buf)
 	  && (hglb = GetClipboardData (format))
 	  && (clipbuf = (cygcb_t *) GlobalLock (hglb)))
 	{
-	  buf->st_atim = buf->st_mtim = clipbuf->timestamp;
+	  struct timespec ts;
+	  ts.tv_sec = clipbuf->tv_sec;
+	  ts.tv_nsec = clipbuf->tv_nsec;
+	  buf->st_atim = buf->st_mtim = ts;
 	  buf->st_size = clipbuf->len;
 	  GlobalUnlock (hglb);
 	}

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

  parent reply	other threads:[~2021-10-08  9:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07  5:22 Mark Geisert
2021-10-07  5:56 ` Mark Geisert
2021-10-08  9:52 ` Takashi Yano [this message]
2021-10-09 14:19   ` Ken Brown
2021-10-09 14:29     ` Jon Turney
2021-10-09 14:43       ` Ken Brown
2021-10-11  6:13         ` Mark Geisert
2021-10-11 12:11           ` Ken Brown
2021-10-22 15:11             ` Corinna Vinschen
2021-10-23  5:35               ` Mark Geisert
2021-10-23 20:32                 ` Ken Brown
2021-10-23 21:53                   ` Mark Geisert
2021-10-23 23:58               ` Takashi Yano
2021-10-25  8:28                 ` Corinna Vinschen

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=20211008185210.cac713f28dea727a1467cf94@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin-patches@cygwin.com \
    /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).