Skip to contentSkip to conversation

cluster/rgmanager/src/clulib msg_cluster.c

Cluster-devel [email protected] 1 participant 1 message Sep 11, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield at sourceware.org 2007-09-11 13:07:24

Modified files:
rgmanager/src/clulib: msg_cluster.c

Log message:
Make it compile with -O2, by fixing a very dodgy cast.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/clulib/msg_cluster.c.diff?cvsroot=cluster&r1=1.5&r2=1.6

rgmanager/src/clulib/msg_cluster.c +4 -3
@@ -249,6 +249,7 @@
 cluster_msg_wait(msgctx_t *ctx, int timeout)
 {
 	struct timespec ts = {0, 0};
+	struct timeval tv = {0, 0};
 	int req = M_NONE;
 	int e;
 
@@ -261,9 +262,9 @@
 		return -1;
 
 	if (timeout > 0) {
-		gettimeofday((struct timeval *)&ts, NULL);
-		ts.tv_sec += timeout;
-		ts.tv_nsec *= 1000;
+		gettimeofday(&tv, NULL);
+		ts.tv_sec = tv.tv_sec + timeout;
+		ts.tv_nsec = tv.tv_usec * 1000;
 	}
 
 	pthread_mutex_lock(&ctx->u.cluster_info.mutex);