All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Anthony Perard <anthony.perard@citrix.com>, Wei Liu <wl@xen.org>
Subject: [PATCH 2/3] console/client: properly use time_t in get_pty_fd()
Date: Thu, 18 Aug 2022 16:06:20 +0200	[thread overview]
Message-ID: <990f432f-1f40-04e4-dfb9-97c8db679f36@suse.com> (raw)
In-Reply-To: <68e71e3b-19a7-e062-9ebe-2e6f6aae0549@suse.com>

"int" is not a suitable type to hold time()'s return value.

Coverity ID: 1509376
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I was on the edge of switching to using difftime() at this occasion as
well. This would then also allow switching "seconds" to unsigned int (or
any other suitable unsigned type).

--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -102,7 +102,7 @@ static int get_pty_fd(struct xs_handle *
 	struct timeval tv;
 	fd_set watch_fdset;
 	int xs_fd = xs_fileno(xs), pty_fd = -1;
-	int start, now;
+	time_t start, now;
 	unsigned int len = 0;
 	char *pty_path, **watch_paths;
 



  parent reply	other threads:[~2022-08-18 14:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 14:03 [PATCH 0/3] tools: address recently reported Coverity issues Jan Beulich
2022-08-18 14:05 ` [PATCH 1/3] xenbaked: properly use time_t in dump_stats() Jan Beulich
2022-08-18 16:34   ` Anthony PERARD
2022-08-19  5:56     ` Jan Beulich
2022-08-18 14:06 ` Jan Beulich [this message]
2022-08-18 16:40   ` [PATCH 2/3] console/client: properly use time_t in get_pty_fd() Anthony PERARD
2022-08-18 14:07 ` [PATCH 3/3] libxl: use time_t for qmp_synchronous_send()'s last parameter Jan Beulich
2022-08-18 14:20   ` Juergen Gross
2022-08-18 14:35     ` Jan Beulich
2022-08-18 16:14   ` Anthony PERARD
2022-08-19  7:59 ` [PATCH v2] xenbaked: properly use time_t in dump_stats() Jan Beulich
2022-08-19  8:27   ` Anthony PERARD

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=990f432f-1f40-04e4-dfb9-97c8db679f36@suse.com \
    --to=jbeulich@suse.com \
    --cc=anthony.perard@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.