Re: [PATCH 4/7] Copy struct inotify_event entries to avoid alignment problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/03/2013 09:06 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> When reading the inotify FD, we get back a sequence of
> struct inotify_event, each with variable length data following.
> It is not safe to simply cast from the char *buf to the
> struct inotify_event struct since this may violate data
> alignment rules. Thus we must copy from the char *buf
> into the struct inotify_event instance before accessing
> the data.
> 
> uml/uml_driver.c: In function 'umlInotifyEvent':
> uml/uml_driver.c:327:13: warning: cast increases required alignment of target type [-Wcast-align]
>          e = (struct inotify_event *)tmp;
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/uml/uml_driver.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]