0001-libmultipath-uevent.c-fix-error-handling-for-udev_mo.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 8579d8a35886f91974e0ac4dbdf2edb7dac06d52 Mon Sep 17 00:00:00 2001
  2. From: Joe Slater <joe.slater@windriver.com>
  3. Date: Fri, 18 Dec 2020 11:17:50 +0800
  4. Subject: [PATCH] libmultipath/uevent.c: fix error handling for
  5. udev_monitor_set_receive_buffer_size
  6. Since systemd v246.5[1], udev_monitor_set_receive_buffer_size() will
  7. return 0 or 1 if successful. We only need to check a negative value for
  8. the failure.
  9. [1] https://github.com/systemd/systemd-stable/commit/4dcae666889ae9469e4406c0bcaffadbc01c4f66
  10. https://github.com/systemd/systemd-stable/commit/fe9b92e566f837665cc06c82374e4e42f9295c99
  11. https://github.com/systemd/systemd-stable/commit/5dd4cc4b10daea5d2ba969425ba02d2098dd06a4
  12. Upstream-Status: Pending
  13. Signed-off-by: Joe Slater <joe.slater@windriver.com>
  14. Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
  15. ---
  16. libmultipath/uevent.c | 3 ++-
  17. 1 file changed, 2 insertions(+), 1 deletion(-)
  18. diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c
  19. index d38e8a7f..4b298052 100644
  20. --- a/libmultipath/uevent.c
  21. +++ b/libmultipath/uevent.c
  22. @@ -810,7 +810,8 @@ int uevent_listen(struct udev *udev)
  23. }
  24. pthread_cleanup_push(monitor_cleanup, monitor);
  25. #ifdef LIBUDEV_API_RECVBUF
  26. - if (udev_monitor_set_receive_buffer_size(monitor, 128 * 1024 * 1024))
  27. + err = udev_monitor_set_receive_buffer_size(monitor, 128 * 1024 * 1024);
  28. + if (err < 0)
  29. condlog(2, "failed to increase buffer size");
  30. #endif
  31. fd = udev_monitor_get_fd(monitor);
  32. --
  33. 2.17.1