From d51a63554f5cf385af5b6e4d7aa1fc64dde3641f Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Fri, 15 Jan 2016 12:24:04 +1100 Subject: [PATCH] ctdb-build: Fix -O3 developer build Signed-off-by: Amitay Isaacs Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Mon Jan 18 14:32:05 CET 2016 on sn-devel-144 --- ctdb/tests/src/pkt_read_test.c | 2 +- ctdb/tests/src/pkt_write_test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ctdb/tests/src/pkt_read_test.c b/ctdb/tests/src/pkt_read_test.c index 6dfd5a04549..7e089ec2541 100644 --- a/ctdb/tests/src/pkt_read_test.c +++ b/ctdb/tests/src/pkt_read_test.c @@ -39,7 +39,7 @@ static void writer(int fd) for (i=0; i<1000; i++) { for (j=0; j<4; j++) { buflen = pkt_size[j]; - *(uint32_t *)buf = buflen; + memcpy(buf, &buflen, sizeof(buflen)); ret = write(fd, buf, buflen); if (ret < 0) { diff --git a/ctdb/tests/src/pkt_write_test.c b/ctdb/tests/src/pkt_write_test.c index 0a5c6540671..191e8b3e894 100644 --- a/ctdb/tests/src/pkt_write_test.c +++ b/ctdb/tests/src/pkt_write_test.c @@ -157,7 +157,7 @@ static void writer(int fd) for (i=0; i<4; i++) { buflen = pkt_size[i]; - *(uint32_t *)buf = buflen; + memcpy(buf, &buflen, sizeof(buflen)); req = writer_send(mem_ctx, ev, fd, buf, buflen); assert(req != NULL); -- 2.34.1