public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jan Friesse <honzaf@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: STABLE2 - fence_ipmilan: Cygwin doesn't like NULL in times function
Date: Thu, 05 Feb 2009 16:55:00 -0000	[thread overview]
Message-ID: <20090205163705.DFABDC024D@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e6f4a34fe817efe20cc044c0ed0de070ee2641cd
Commit:        e6f4a34fe817efe20cc044c0ed0de070ee2641cd
Parent:        c044ad0d53e277e5a33de0cb12d09dc28bc86d6a
Author:        Jan Friesse <jfriesse@redhat.com>
AuthorDate:    Thu Feb 5 17:32:00 2009 +0100
Committer:     Jan Friesse <jfriesse@redhat.com>
CommitterDate: Thu Feb 5 17:36:50 2009 +0100

fence_ipmilan: Cygwin doesn't like NULL in times function

Times function was used with NULL parameter. On Linux everything
worked, but Cygwin doesn't like this (returned value was -1). This
patch add foo_tms, which is argument for times. This shouldn't hurt
anything, but makes Cygwin happy.
---
 fence/agents/ipmilan/expect.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fence/agents/ipmilan/expect.c b/fence/agents/ipmilan/expect.c
index fa85bd8..45deb6a 100644
--- a/fence/agents/ipmilan/expect.c
+++ b/fence/agents/ipmilan/expect.c
@@ -68,7 +68,7 @@ ExpectToken(int	fd, struct Etoken * toklist, int to_secs, char * buf
 	clock_t		ticks;
 	int		nchars = 1; /* reserve space for an EOS */
 	struct timeval	tv;
-
+	struct tms      foo_tms; /*This tms is used, because cygwin doesn't like NULL in times*/
 	struct Etoken *	this;
 
 	/* Figure out when to give up.  Handle lbolt wraparound */
@@ -77,7 +77,7 @@ ExpectToken(int	fd, struct Etoken * toklist, int to_secs, char * buf
 		return -1;
 	}
 	
-	starttime = times(NULL);
+	starttime = times(&foo_tms);
 	ticks = (to_secs*CLOCKS_PER_SEC);
 	endtime = starttime + ticks;
 
@@ -94,7 +94,7 @@ ExpectToken(int	fd, struct Etoken * toklist, int to_secs, char * buf
 	}
 
 
-	while (now = times(NULL),
+	while (now = times(&foo_tms),
 		(wraparound && (now > starttime || now <= endtime))
 		||	(!wraparound && now <= endtime)) {
 


                 reply	other threads:[~2009-02-05 16:55 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=20090205163705.DFABDC024D@lists.fedorahosted.org \
    --to=honzaf@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.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).