Explorar el Código

defect 981
This patch fixes a problem where the synchronization engine would not work
cross endian.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@935 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake hace 20 años
padre
commit
62120cb81a
Se han modificado 1 ficheros con 14 adiciones y 1 borrados
  1. 14 1
      exec/sync.c

+ 14 - 1
exec/sync.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005 MontaVista Software, Inc.
+ * Copyright (c) 2005-2006 MontaVista Software, Inc.
  *
  * All rights reserved.
  *
@@ -54,6 +54,7 @@
 #include "totempg.h"
 #include "ykd.h"
 #include "print.h"
+#include "swab.h"
 
 #define LOG_SERVICE LOG_SERVICE_SYNC
 
@@ -291,6 +292,14 @@ void sync_primary_callback_fn (
 
 static struct memb_ring_id deliver_ring_id;
 
+void sync_endian_convert (struct req_exec_sync_barrier_start *req_exec_sync_barrier_start)
+{
+	totemip_copy_endian_convert(&req_exec_sync_barrier_start->ring_id.rep,
+		&req_exec_sync_barrier_start->ring_id.rep);
+	req_exec_sync_barrier_start->ring_id.seq = swab64 (req_exec_sync_barrier_start->ring_id.seq);
+
+}
+
 void sync_deliver_fn (
 	struct totem_ip_address *source_addr,
 	struct iovec *iovec,
@@ -303,6 +312,10 @@ void sync_deliver_fn (
 
 	int i;
 
+	if (endian_conversion_required) {
+		sync_endian_convert (req_exec_sync_barrier_start);
+	}
+
 	int barrier_completed = 1;
 
 	memcpy (&deliver_ring_id, &req_exec_sync_barrier_start->ring_id,