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--
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 "G4iJoqBmSsgzjU Ce" Disposition: inline
Content-Type: multipart/mixed; boundary=
Content-
--G4iJoqBmSsgzjUCe Disposition: inline Transfer- Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8
Content-
Content-
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 Disposition: attachment; filename=diff Transfer- Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8
Content-
Content-
diff -urN udev-072. orig/udevd. c udev-072/udevd.c orig/udevd. c 2005-11-05 22:05:35.000000000 +0100 &readfds) ; signal_ pipe[READ_ END], &readfds); pipe[READ_ END]; udevd_sock, &readfds); uevent_ netlink_ sock, &readfds); netlink_ sock); SET(inotify_ fd, &readfds); UDEV_MAX( uevent_ netlink_ sock, inotify_fd)+1, &readfds=
--- udev-072.
+++ udev-072/udevd.c 2005-11-07 00:01:32.000000000 +0100
@@ -996,12 +996,17 @@
=20
FD_ZERO(
FD_SET(
+ fdcount =3D signal_
FD_SET(
+ fdcount =3D UDEV_MAX(fdcount, udevd_sock);
FD_SET(
- if (inotify_fd > 0)
+ fdcount =3D UDEV_MAX(fdcount, uevent_
+ if (inotify_fd > 0) {
FD_
+ fdcount =3D UDEV_MAX(fdcount, inotify_fd);
+ }
=20
- fdcount =3D select(
, 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));
--G4iJoqBmSsgzj UCe--
--b5gNqxB1S1yM7hjW pgp-signature; name="signature .asc" Description: Digital signature Disposition: inline
Content-Type: application/
Content-
Content-
-----BEGIN PGP SIGNATURE-----
ujJcACgkQnw66O/ MvCNEfAQCfV+ ZemwwcXFDyfsN0m 6n5dzir 6n1NcsJl6V8lluG QC
Version: GnuPG v1.4.2 (GNU/Linux)
iEYEARECAAYFAkN
pc4An0enqxbZsix
=OIWC
-----END PGP SIGNATURE-----
--b5gNqxB1S1yM7 hjW--