public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Joerg Vehlow <lkml@jv-coder.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] mq_timedreceive_5-3: Fix test for timestamp after INT32_MAX
Date: Wed,  3 Feb 2021 08:45:20 +0100	[thread overview]
Message-ID: <20210203074520.18401-2-lkml@jv-coder.de> (raw)
In-Reply-To: <20210203074520.18401-1-lkml@jv-coder.de>

From: Joerg Vehlow <joerg.vehlow@aox-tech.de>

The timeout for mq_timedreceive is absolute. Using INT32_MAX
breaks this test after 2038-01-19.

Signed-off-by: Joerg Vehlow <joerg.vehlow@aox-tech.de>
---
 .../conformance/interfaces/mq_timedreceive/5-3.c               | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-3.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-3.c
index 3f252a196..89d40721e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mq_timedreceive/5-3.c
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <time.h>
 #include "posixtest.h"
 
 #define TEST "5-3"
@@ -70,7 +71,7 @@ int main(void)
 		sigemptyset(&act.sa_mask);
 		sigaction(SIGABRT, &act, 0);
 
-		ts.tv_sec = INT32_MAX;
+		ts.tv_sec = time(NULL) + 5;
 		ts.tv_nsec = 0;
 
 		if (mq_timedreceive(mqdes, msgrv, BUFFER, NULL, &ts) == -1) {
-- 
2.25.1


  reply	other threads:[~2021-02-03  7:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  7:45 [LTP] [PATCH 1/2] mq_timedreceive/5-3: Prevent override of errno Joerg Vehlow
2021-02-03  7:45 ` Joerg Vehlow [this message]
2021-02-03  7:48   ` [LTP] [PATCH 2/2] mq_timedreceive_5-3: Fix test for timestamp after INT32_MAX Joerg Vehlow
2021-02-12 15:15     ` Cyril Hrubis

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=20210203074520.18401-2-lkml@jv-coder.de \
    --to=lkml@jv-coder.de \
    --cc=ltp@lists.linux.it \
    /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