From 8abeb3bc1ac03eb633871b379364b01ca9b4a813 Mon Sep 17 00:00:00 2001 From: Archaic Date: Wed, 3 May 2006 19:43:38 +0000 Subject: Updated the bug.c code to avoid USB-related uevent leakage reports. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7584 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/udev.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'chapter06') diff --git a/chapter06/udev.xml b/chapter06/udev.xml index 94178b8a2..4dfa9e867 100644 --- a/chapter06/udev.xml +++ b/chapter06/udev.xml @@ -138,12 +138,22 @@ ln -sv /proc/kcore /lib/udev/devices/core #include <argz.h> int main(int argc, char * argv[]) { + char * envar; char * envz; size_t len; int bug; bug = open("/dev/bug", O_WRONLY | O_APPEND); if (bug == -1) - return 0; + return 0; + + /* Ignore everything USB-related to avoid spamming the list */ + envar = getenv("PHYSDEVPATH"); + if (envar && strstr(envar, "usb")) + return 0; + envar = getenv("DEVPATH"); + if (envar && strstr(envar, "usb")) + return 0; + setenv("_SEPARATOR", "-------------------------------", 1); argz_create(environ, &envz, &len); argz_stringify(envz, len, '\n'); -- cgit v1.2.3-54-g00ecf