X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=libudev%2Flibudev-monitor.c;h=a3789c4d1340561e468f1b32629c2c9cfe0be18e;hp=24e8aead2635595898aa6479aa25d023607fbdf6;hb=4cbe7095226e0e4a050ef347ddc297386a571557;hpb=28460195c2ae90892bf556aff2b80705a8f37795 diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c index 24e8aead2..a3789c4d1 100644 --- a/libudev/libudev-monitor.c +++ b/libudev/libudev-monitor.c @@ -400,6 +400,16 @@ int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor) return 0; } +/** + * udev_monitor_set_receive_buffer_size: + * @udev_monitor: the monitor which should receive events + * @size: the size in bytes + * + * Set the size of the kernel socket buffer. This call needs the + * appropriate privileges to succeed. + * + * Returns: 0 on success, otherwise -1 on error. + */ int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size) { if (udev_monitor == NULL) @@ -615,8 +625,11 @@ retry: if (memcmp(buf, "libudev", 8) == 0) { /* udev message needs proper version magic */ nlh = (struct udev_monitor_netlink_header *) buf; - if (nlh->magic != htonl(UDEV_MONITOR_MAGIC)) + if (nlh->magic != htonl(UDEV_MONITOR_MAGIC)) { + err(udev_monitor->udev, "ignored a message from an invalid release of udevadm (%x != %x)\n", + nlh->magic, htonl(UDEV_MONITOR_MAGIC)); return NULL; + } if (nlh->properties_off+32 > buflen) return NULL; bufpos = nlh->properties_off;