commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 13/75: Clean debugging macro


From: Samuel Thibault
Subject: [hurd] 13/75: Clean debugging macro
Date: Thu, 14 Jan 2016 01:04:02 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch dde
in repository hurd.

commit 75ee933b844a3cf0f1dc3a99337ee3b557d49631
Author: Samuel Thibault <address@hidden>
Date:   Sun Nov 29 12:43:42 2015 +0100

    Clean debugging macro
    
    * util.h (debug): Rename into...
    (devnode_debug): ... new macro. Catenate formats instead of using snprintf
    in a fixed-size buffer.
    * devnode.c (ds_device_open, trivfs_goaway): Use devnode_debug instead of
    debug.
---
 devnode/devnode.c | 6 +++---
 devnode/util.h    | 8 +++-----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/devnode/devnode.c b/devnode/devnode.c
index 6ec8a65..2802471 100644
--- a/devnode/devnode.c
+++ b/devnode/devnode.c
@@ -145,7 +145,7 @@ ds_device_open (mach_port_t master_port, mach_port_t 
reply_port,
 {
   error_t err;
 
-  debug ("ds_device_open is called\n");
+  devnode_debug ("ds_device_open is called\n");
 
   if ((user_device_name && strcmp (user_device_name, name))
       || device_name == NULL) 
@@ -273,7 +273,7 @@ trivfs_goaway (struct trivfs_control *fsys, int flags)
   ports_inhibit_class_rpcs (trivfs_protid_class);
 
   count = ports_count_class (trivfs_protid_class);
-  debug ("the number of ports alive: %d\n", count);
+  devnode_debug ("the number of ports alive: %d\n", count);
 
   if (count && !(flags & FSYS_GOAWAY_FORCE)) 
     {
@@ -285,7 +285,7 @@ trivfs_goaway (struct trivfs_control *fsys, int flags)
     } 
 
   mach_port_deallocate (mach_task_self (), master_device);
-  debug ("the translator is gone away\n");
+  devnode_debug ("the translator is gone away\n");
   exit (0);
 }
 
diff --git a/devnode/util.h b/devnode/util.h
index 2efc1ef..f3cc3c1 100644
--- a/devnode/util.h
+++ b/devnode/util.h
@@ -25,17 +25,15 @@
 
 #ifdef DEBUG 
 
-#define debug(format, ...) do                          \
+#define devnode_debug(format, ...) do                  \
 {                                                      \
-  char buf[1024];                                       \
-  snprintf (buf, 1024, "devnode: %s", format);       \
-  fprintf (stderr , buf, ## __VA_ARGS__);              \
+  fprintf (stderr , "devnode: " format, ## __VA_ARGS__);\
   fflush (stderr);                                     \
 } while (0)
 
 #else
 
-#define debug(format, ...) do {} while (0)
+#define devnode_debug(format, ...) do {} while (0)
 
 #endif
 

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]