]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virNetServerClientNewPostExecRestart: Avoid align problems
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 5 May 2016 07:07:50 +0000 (09:07 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 5 May 2016 11:48:56 +0000 (13:48 +0200)
commitb17e610e1f1ff91c3b1df5a1e56291b7e0956701
tree3edab4b5dd7dc293d57e0108f72948c54724fcf0
parent2a3a2c2f5bea5d5cafba3b96c843acd67f791098
virNetServerClientNewPostExecRestart: Avoid align problems

I've noticed this while trying to compile libvirt on my arm box.

  CC       rpc/libvirt_net_rpc_server_la-virnetserverclient.lo
rpc/virnetserverclient.c: In function 'virNetServerClientNewPostExecRestart':
rpc/virnetserverclient.c:516:45: error: cast increases required alignment of target type [-Werror=cast-align]
                                             (long long *) &timestamp) < 0) {
                                             ^
cc1: all warnings being treated as errors

Problem is, @timestap is defined as time_t which is 32 bits long,
and we are typecasting it to long long which is 64bits long.
Solution is to make @timestamp type of long long. At the same
time, we can make @conn_time in _virNetServerClient struct long
long too. There is no need for it to be type of time_t.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/rpc/virnetserverclient.c