From: lhh@sourceware.org <lhh@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/rgmanager/src/daemons rg_state.c
Date: 2 Jan 2008 19:54:28 -0000 [thread overview]
Message-ID: <20080102195428.19557.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: lhh at sourceware.org 2008-01-02 19:54:28
Modified files:
rgmanager/src/daemons: rg_state.c
Log message:
Fix endian issue on big-endian arches
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_state.c.diff?cvsroot=cluster&r1=1.44&r2=1.45
--- cluster/rgmanager/src/daemons/rg_state.c 2007/12/30 08:27:21 1.44
+++ cluster/rgmanager/src/daemons/rg_state.c 2008/01/02 19:54:28 1.45
@@ -270,6 +270,7 @@
set_rg_state(char *name, rg_state_t *svcblk)
{
char res[256];
+ rg_state_t svcblk_store;
#ifndef OPENAIS
cluster_member_list_t *membership;
int ret, tries = 0;
@@ -279,8 +280,12 @@
strncpy(svcblk->rs_name, name, sizeof(svcblk->rs_name));
snprintf(res, sizeof(res), "rg=\"%s\"", name);
+
+ memcpy(&svcblk_store, svcblk, sizeof(svcblk_store));
+ swab_rg_state_t(&svcblk_store);
+
#ifdef OPENAIS
- if (ds_write(res, svcblk, sizeof(*svcblk)) < 0)
+ if (ds_write(res, &svcblk_store, sizeof(svcblk_store)) < 0)
return -1;
return 0;
#else
@@ -288,8 +293,9 @@
/* Retry up to 3 times just in case members transition
while we're trying to commit something */
membership = member_list();
- ret = vf_write(membership, VFF_IGN_CONN_ERRORS, res, svcblk,
- sizeof(*svcblk));
+ ret = vf_write(membership, VFF_IGN_CONN_ERRORS, res,
+ &svcblk_store,
+ sizeof(svcblk_store));
free_member_list(membership);
} while (ret == VFR_TIMEOUT && ++tries < 3);
@@ -360,6 +366,7 @@
}
memcpy(svcblk, data, sizeof(*svcblk));
+ swab_rg_state_t(svcblk);
return 0;
#else
@@ -399,6 +406,7 @@
/* Copy out the data. */
memcpy(svcblk, data, sizeof(*svcblk));
+ swab_rg_state_t(svcblk);
free(data);
free_member_list(membership);
@@ -452,6 +460,7 @@
/* Copy out the data. */
memcpy(svcblk, data, sizeof(*svcblk));
+ swab_rg_state_t(svcblk);
#ifndef OPENAIS
free(data);
#endif
next reply other threads:[~2008-01-02 19:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-02 19:54 lhh [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-02-05 19:47 [Cluster-devel] cluster/rgmanager/src/daemons rg_state.c lhh
2008-02-01 17:21 lhh
2008-02-01 15:31 lhh
2008-01-25 16:04 lhh
2008-01-16 18:51 lhh
2008-01-16 18:50 lhh
2007-06-25 16:49 lhh
2007-06-22 14:23 lhh
2007-01-16 15:32 lhh
2007-01-16 15:31 lhh
2007-01-16 15:29 lhh
2006-09-28 20:02 lhh
2006-09-28 20:01 lhh
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=20080102195428.19557.qmail@sourceware.org \
--to=lhh@sourceware.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.