]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Copy struct inotify_event entries to avoid alignment problems
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 3 Apr 2013 13:33:56 +0000 (14:33 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 8 Apr 2013 09:03:21 +0000 (10:03 +0100)
commit7e6aabc61f02f78fd8b229914744c127b83dec76
tree4713e4cd239e82ed6a2f9b5d5a28f95e6149ead1
parentc4f9edf1a1efda21271f6cf5d08e574548488a3f
Copy struct inotify_event entries to avoid alignment problems

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@redhat.com>
src/uml/uml_driver.c