From 513181026549355c54d899eafe207242db86b079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 14 Aug 2013 21:26:37 +0200 Subject: [PATCH] qubes-rpc/filecopy: use explicit struct alignment This is much more readable, than guessing exact struct packing done by gcc on x86_64. --- qrexec-lib/libqubes-rpc-filecopy.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qrexec-lib/libqubes-rpc-filecopy.h b/qrexec-lib/libqubes-rpc-filecopy.h index 9f9fbae..4dc00f5 100644 --- a/qrexec-lib/libqubes-rpc-filecopy.h +++ b/qrexec-lib/libqubes-rpc-filecopy.h @@ -29,6 +29,8 @@ #define LEGAL_EOF 31415926 +#include + struct file_header { unsigned int namelen; unsigned int mode; @@ -40,9 +42,10 @@ struct file_header { }; struct result_header { - unsigned int error_code; - unsigned long crc32; -}; + uint32_t error_code; + uint32_t _pad; + uint64_t crc32; +} __attribute__((packed)); enum { COPY_FILE_OK,