From: Matthias Schwarzott <zzam@gentoo.org>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] Fix inotify to work not only once
Date: Thu, 26 Jul 2007 09:14:50 +0000 [thread overview]
Message-ID: <200707261114.50213.zzam@gentoo.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 525 bytes --]
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)
[-- Attachment #2: udev-fix-inotify.diff --]
[-- Type: text/x-diff, Size: 372 bytes --]
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;
[-- Attachment #3: Type: text/plain, Size: 315 bytes --]
-------------------------------------------------------------------------
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/
[-- Attachment #4: Type: text/plain, Size: 226 bytes --]
_______________________________________________
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
next reply other threads:[~2007-07-26 9:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-26 9:14 Matthias Schwarzott [this message]
2007-07-26 11:03 ` [PATCH] Fix inotify to work not only once Kay Sievers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200707261114.50213.zzam@gentoo.org \
--to=zzam@gentoo.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).