chiark / gitweb /
Add initialization helper for file_handle_union
[elogind.git] / src / libudev / libudev-monitor.c
index 484fefeebfe27261167aef5acbf7cb6f26c4f41c..da2b63473f3aebe5a83b46202eea3a13077e34c1 100644 (file)
@@ -109,10 +109,7 @@ static struct udev_monitor *udev_monitor_new(struct udev *udev)
 /* we consider udev running when /dev is on devtmpfs */
 static bool udev_has_devtmpfs(struct udev *udev) {
 
-        union file_handle_union h = {
-                .handle.handle_bytes = MAX_HANDLE_SZ
-        };
-
+        union file_handle_union h = FILE_HANDLE_INIT;
         _cleanup_fclose_ FILE *f = NULL;
         char line[LINE_MAX], *e;
         int mount_id;
@@ -609,7 +606,7 @@ retry:
                 return NULL;
         }
 
-        if (buflen < 32 || (size_t)buflen >= sizeof(buf)) {
+        if (buflen < 32 || (smsg.msg_flags & MSG_TRUNC)) {
                 log_debug("invalid message length");
                 return NULL;
         }