diff --git a/modules/sensors/dynamic_sensor/ConnectionDetector.cpp b/modules/sensors/dynamic_sensor/ConnectionDetector.cpp index 85b99017..99dab5b0 100644 --- a/modules/sensors/dynamic_sensor/ConnectionDetector.cpp +++ b/modules/sensors/dynamic_sensor/ConnectionDetector.cpp @@ -194,9 +194,9 @@ void FileConnectionDetector::handleInotifyData(ssize_t len, const char *data) { } bool FileConnectionDetector::readInotifyData() { - struct { + union { struct inotify_event ev; - char padding[NAME_MAX + 1]; + char raw[sizeof(inotify_event) + NAME_MAX + 1]; } buffer; bool ret = true;