public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: Mark Geisert <mgeisert@sourceware.org>
To: cygwin-apps-cvs@sourceware.org
Subject: [cygutils - Chuck Wilson's collection of Cygwin utilities] branch master, updated. v1_4_16-10-gecb7644
Date: Fri,  5 Nov 2021 08:45:10 +0000 (GMT)	[thread overview]
Message-ID: <20211105084510.ACA733858D35@sourceware.org> (raw)




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/cygutils.git;h=ecb76449ca233873d01feacd3dfd22cbf7e95e34

commit ecb76449ca233873d01feacd3dfd22cbf7e95e34
Author: Mark Geisert <mark@maxrnd.com>
Date:   Fri Nov 5 01:45:01 2021 -0700

    Add missing 32/64 timespec expansion


Diff:
---
 src/clip/putclip.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/clip/putclip.c b/src/clip/putclip.c
index 13158bd..fb54416 100644
--- a/src/clip/putclip.c
+++ b/src/clip/putclip.c
@@ -563,8 +563,16 @@ putclip (FILE * in, flags_struct flags, FILE * f, char *name)
       if (cygNewFormat == 2)
         {
           cygcb_t *clipbufX = (cygcb_t *) clipbuf;
-          clipbufX->cb_size = convlen;
           clock_gettime (CLOCK_REALTIME, &clipbufX->ts);
+#ifdef __x86_64__
+          /* ts overlays cb_sec and cb_nsec such that no conversion is needed */
+#elif __i386__
+          /* Expand 32-bit timespec layout to 64-bit layout.
+             NOTE: Steps must be done in this order to avoid data loss. */
+          clipbufX->cb_nsec = clipbufX->ts.tv_nsec;
+          clipbufX->cb_sec  = clipbufX->ts.tv_sec;
+#endif
+          clipbufX->cb_size = convlen;
           memcpy (&clipbufX[1], convbuf, convlen);
         }
       else if (cygNewFormat == 1)



                 reply	other threads:[~2021-11-05  8:45 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=20211105084510.ACA733858D35@sourceware.org \
    --to=mgeisert@sourceware.org \
    --cc=cygwin-apps-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).