svn commit: trunk/busybox/util-linux

vda at busybox.net vda at busybox.net
Sat May 31 18:27:59 UTC 2008


Author: vda
Date: 2008-05-31 11:27:58 -0700 (Sat, 31 May 2008)
New Revision: 22152

Log:
mdev: add commented-out debug code to open stdio.



Modified:
   trunk/busybox/util-linux/mdev.c


Changeset:
Modified: trunk/busybox/util-linux/mdev.c
===================================================================
--- trunk/busybox/util-linux/mdev.c	2008-05-31 17:15:37 UTC (rev 22151)
+++ trunk/busybox/util-linux/mdev.c	2008-05-31 18:27:58 UTC (rev 22152)
@@ -392,6 +392,15 @@
 	char *env_path;
 	RESERVE_CONFIG_BUFFER(temp, PATH_MAX + SCRATCH_SIZE);
 
+#ifdef YOU_WANT_TO_DEBUG_HOTPLUG_EVENTS
+	/* Kernel cannot provide suitable stdio fds for us, do it ourself */
+	/* Replace LOGFILE by other file or device name if you need */
+#define LOGFILE "/dev/console"
+	xmove_fd(xopen("/dev/null", O_RDONLY), STDIN_FILENO);
+	xmove_fd(xopen(LOGFILE, O_WRONLY|O_APPEND), STDOUT_FILENO);
+	xmove_fd(xopen(LOGFILE, O_WRONLY|O_APPEND), STDERR_FILENO);
+#endif
+
 	xchdir("/dev");
 
 	if (argc == 2 && !strcmp(argv[1], "-s")) {




More information about the busybox-cvs mailing list