[K42-discussion] patch to silence debug output in mknod()

Andrew Baumann andrewb at cse.unsw.edu.au
Sat Apr 8 16:40:20 EST 2006


Hi,

this patch silences some debug output from mknod() when the RUN_SILENT flag is 
set. Is the output still required? If not, I would be tempted to just turn 
off the VERBOSE_MKNOD define.

Signed-off-by: Andrew Baumann <andrewb at cse.unsw.edu.au>

Cheers,
Andrew


--- kitch-linux/lib/emu/mknod.C 6 May 2005 15:28:07 -0000       1.13
+++ kitch-linux/lib/emu/mknod.C 8 Apr 2006 05:16:52 -0000
@@ -26,18 +26,22 @@
 {
     SysStatus rc;

-    #define VERBOSE_MKNOD
-    #ifdef VERBOSE_MKNOD
-    err_printf("%s: pathname %s  mode=0x%lx  dev=0x%lx\n",
-       __PRETTY_FUNCTION__,
-       pathname, mode, dev);
-    #endif     // VERBOSE_MKNOD
+#define VERBOSE_MKNOD
+#ifdef VERBOSE_MKNOD
+    if (!KernelInfo::ControlFlagIsSet(KernelInfo::RUN_SILENT)) {
+       err_printf("%s: pathname %s  mode=0x%lx  dev=0x%lx\n",
+           __PRETTY_FUNCTION__,
+           pathname, mode, dev);
+    }
+#endif // VERBOSE_MKNOD

     rc = FileLinux::Mknod(pathname, mode, dev);
     if (_FAILURE(rc)) {
-        #ifdef VERBOSE_MKNOD
-       _SERROR_EPRINT(rc);
-        #endif // VERBOSE_MKNOD
+#ifdef VERBOSE_MKNOD
+       if (!KernelInfo::ControlFlagIsSet(KernelInfo::RUN_SILENT)) {
+           _SERROR_EPRINT(rc);
+       }
+#endif // VERBOSE_MKNOD
        return -_SGENCD(rc);
     }
     return 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/k42-discussion/attachments/20060408/9d2ea52c/attachment.pgp 


More information about the K42-discussion mailing list