mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-20 00:11:31 +00:00
spa: v4l2: Convert buf structure to union and fix alignment
The inotify_event field has a variable sized type, so it's recommended to store it at the end of the storage unit. Fixes gnu-variable-sized-type-not-at-end warning.
This commit is contained in:
parent
ec7ed1275e
commit
6b1c483cf7
|
@ -411,9 +411,9 @@ static void impl_on_notify_events(struct spa_source *source)
|
|||
{
|
||||
bool deleted = false;
|
||||
struct impl *this = source->data;
|
||||
struct {
|
||||
struct inotify_event e;
|
||||
char name[NAME_MAX+1];
|
||||
union {
|
||||
unsigned char name[sizeof(struct inotify_event) + NAME_MAX + 1];
|
||||
struct inotify_event e; /* for appropriate alignment */
|
||||
} buf;
|
||||
|
||||
while (true) {
|
||||
|
|
Loading…
Reference in a new issue