aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06
diff options
context:
space:
mode:
Diffstat (limited to 'chapter06')
-rw-r--r--chapter06/udev.xml12
1 files changed, 11 insertions, 1 deletions
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</userinput></screen>
#include &lt;argz.h&gt;
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 &amp;&amp; strstr(envar, "usb"))
+ return 0;
+ envar = getenv("DEVPATH");
+ if (envar &amp;&amp; strstr(envar, "usb"))
+ return 0;
+
setenv("_SEPARATOR", "-------------------------------", 1);
argz_create(environ, &amp;envz, &amp;len);
argz_stringify(envz, len, '\n');