Bug#598198: acpid: superfluous logging

2010-09-29 Thread Ferenc Wagner
Ted Felix  writes:

> Try the attached patch (d598198.diff)

Seems to work as expected.
-- 
Thanks,
Feri.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#598198: acpid: superfluous logging

2010-09-28 Thread Ted Felix

   Try the attached patch.
diff -N -r -U 10 -x '*.o' -x '*~' -x '.*' -x '*.out' -x CVS -x '*.moc' 
acpid-2.0.6/event.c acpid/event.c
--- acpid-2.0.6/event.c 2010-03-28 10:00:04.0 -0400
+++ acpid/event.c   2010-09-27 18:26:48.0 -0400
@@ -115,20 +115,26 @@
}
 
/* scan all the files */
while ((dirent = readdir(dir))) {
int len;
struct rule *r;
struct stat stat_buf;
 
len = strlen(dirent->d_name);
 
+   /* skip "." and ".." */
+   if (strncmp(dirent->d_name, ".", sizeof(dirent->d_name)) == 0)
+   continue;
+   if (strncmp(dirent->d_name, "..", sizeof(dirent->d_name)) == 0)
+   continue;
+
/* skip any files that don't match the run-parts convention */
if (regexec(&preg, dirent->d_name, 0, NULL, 0) != 0) {
acpid_log(LOG_INFO, "skipping conf file %s/%s\n", 
confdir, dirent->d_name);
continue;
}
 
/* Compute the length of the full path name adding one for */
/* the slash and one more for the NULL. */
len += strlen(confdir) + 2;
diff -N -r -U 10 -x '*.o' -x '*~' -x '.*' -x '*.out' -x CVS -x '*.moc' 
acpid-2.0.6/proc.c acpid/proc.c
--- acpid-2.0.6/proc.c  2010-03-28 10:02:42.0 -0400
+++ acpid/proc.c2010-09-27 18:30:28.0 -0400
@@ -81,21 +81,21 @@
 
 int
 open_proc()
 {
int fd;
struct connection c;

fd = open(eventfile, O_RDONLY);
if (fd < 0) {
if (errno == ENOENT) {
-   acpid_log(LOG_INFO, "Deprecated %s was not found.  "
+   acpid_log(LOG_DEBUG, "Deprecated %s was not found.  "
"Trying netlink and the input layer...\n", 
eventfile);
} else {
acpid_log(LOG_ERR, "can't open %s: %s (%d)\n", 
eventfile, 
strerror(errno), errno);
}
return -1;

}
fcntl(fd, F_SETFD, FD_CLOEXEC);
 


Bug#598198: acpid: superfluous logging

2010-09-27 Thread Ferenc Wagner
Package: acpid
Version: 1:2.0.6-1
Severity: minor

Hi,

Starting up acpid results in the following lines in syslog:

acpid: Deprecated /proc/acpi/event was not found.  Trying netlink and the input 
layer...
acpid: starting up with netlink and the input layer
acpid: skipping conf file /etc/acpi/events/.
acpid: skipping conf file /etc/acpi/events/..
acpid: 1 rule loaded
acpid: waiting for events: event logging is off

Overall verbosity notwithstanding, considering . and .. conf files
seems rather misguided.
Please suppress logging (or even better: checking) of those directory
entries.

Also, why log that something deprecated (/proc/acpi/event) wasn't found?

Thanks,
Feri.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org