Comment 2 for bug 25087

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Mon, 7 Nov 2005 00:07:03 +0100
From: Bastian Blank <email address hidden>
To: <email address hidden>
Subject: udev - udevd fails to timeout events if the kernel have no inotify

--b5gNqxB1S1yM7hjW
Content-Type: multipart/mixed; boundary="G4iJoqBmSsgzjUCe"
Content-Disposition: inline

--G4iJoqBmSsgzjUCe
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Package: udev
Version: 0.72-2
Severity: grave

udevd fails to timeout events if it runs on a kernel without inotify.
The attached patch fixes the select call.

Bastian

--=20
Actual war is a very messy business. Very, very messy business.
  -- Kirk, "A Taste of Armageddon", stardate 3193.0

--G4iJoqBmSsgzjUCe
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename=diff
Content-Transfer-Encoding: quoted-printable

diff -urN udev-072.orig/udevd.c udev-072/udevd.c
--- udev-072.orig/udevd.c 2005-11-05 22:05:35.000000000 +0100
+++ udev-072/udevd.c 2005-11-07 00:01:32.000000000 +0100
@@ -996,12 +996,17 @@
=20
   FD_ZERO(&readfds);
   FD_SET(signal_pipe[READ_END], &readfds);
+ fdcount =3D signal_pipe[READ_END];
   FD_SET(udevd_sock, &readfds);
+ fdcount =3D UDEV_MAX(fdcount, udevd_sock);
   FD_SET(uevent_netlink_sock, &readfds);
- if (inotify_fd > 0)
+ fdcount =3D UDEV_MAX(fdcount, uevent_netlink_sock);
+ if (inotify_fd > 0) {
    FD_SET(inotify_fd, &readfds);
+ fdcount =3D UDEV_MAX(fdcount, inotify_fd);
+ }
=20
- fdcount =3D select(UDEV_MAX(uevent_netlink_sock, inotify_fd)+1, &readfds=
, NULL, NULL, NULL);
+ fdcount =3D select(fdcount+1, &readfds, NULL, NULL, NULL);
   if (fdcount < 0) {
    if (errno !=3D EINTR)
     dbg("error in select: %s", strerror(errno));

--G4iJoqBmSsgzjUCe--

--b5gNqxB1S1yM7hjW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iEYEARECAAYFAkNujJcACgkQnw66O/MvCNEfAQCfV+ZemwwcXFDyfsN0m6n5dzir
pc4An0enqxbZsix6n1NcsJl6V8lluGQC
=OIWC
-----END PGP SIGNATURE-----

--b5gNqxB1S1yM7hjW--