From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Schwarzott Date: Thu, 26 Jul 2007 09:14:50 +0000 Subject: [PATCH] Fix inotify to work not only once Message-Id: <200707261114.50213.zzam@gentoo.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Boundary-00=_KYGqG7kjELN+NzR" List-Id: To: linux-hotplug@vger.kernel.org --Boundary-00=_KYGqG7kjELN+NzR Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi there! The inotify code in udevd.c contains a bug disabling inotify after first modification catch. The patch entitled "handle dynamic rules created in /dev/.udev/rules.d/" contains this: buf = malloc(nbytes); - if (!buf) { + if (buf != NULL) { err("error getting buffer for inotify, disable watching"); But this makes the code disable inotify if malloc is successful. Shouldnt this be buf == NULL, or just the original !buf. The attached patch fixes this. Matthias -- Matthias Schwarzott (zzam) --Boundary-00=_KYGqG7kjELN+NzR Content-Type: text/x-diff; charset="utf-8"; name="udev-fix-inotify.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="udev-fix-inotify.diff" diff --git a/udevd.c b/udevd.c index 69572c6..8f56de6 100644 --- a/udevd.c +++ b/udevd.c @@ -1202,7 +1202,7 @@ int main(int argc, char *argv[], char *envp[]) reload_config = 1; buf = malloc(nbytes); - if (buf != NULL) { + if (buf == NULL) { err("error getting buffer for inotify, disable watching"); close(inotify_fd); inotify_fd = -1; --Boundary-00=_KYGqG7kjELN+NzR Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ --Boundary-00=_KYGqG7kjELN+NzR Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel --Boundary-00=_KYGqG7kjELN+NzR--