From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32734 invoked by alias); 5 Feb 2009 16:55:55 -0000 Received: (qmail 32726 invoked by alias); 5 Feb 2009 16:55:55 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com Subject: cluster: STABLE2 - fence_ipmilan: Cygwin doesn't like NULL in times function To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE2 X-Git-Reftype: branch X-Git-Oldrev: c044ad0d53e277e5a33de0cb12d09dc28bc86d6a X-Git-Newrev: e6f4a34fe817efe20cc044c0ed0de070ee2641cd From: Jan Friesse Message-Id: <20090205163705.DFABDC024D@lists.fedorahosted.org> Date: Thu, 05 Feb 2009 16:55:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00391.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e6f4a34fe817efe20cc044c0ed0de070ee2641cd Commit: e6f4a34fe817efe20cc044c0ed0de070ee2641cd Parent: c044ad0d53e277e5a33de0cb12d09dc28bc86d6a Author: Jan Friesse AuthorDate: Thu Feb 5 17:32:00 2009 +0100 Committer: Jan Friesse 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)) {