[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
- [hurd] branch dde updated (c7fdc30 -> cb08549), Samuel Thibault, 2016/01/13
- [hurd] 04/75: random: fix odd formatting, Samuel Thibault, 2016/01/13
- [hurd] 06/75: random: use /servers/startup to register for shutdown notifications, Samuel Thibault, 2016/01/13
- [hurd] 07/75: random: satisfy arbitrarily-sized reads, Samuel Thibault, 2016/01/13
- [hurd] 08/75: libihash: add hurd_ihash_value_valid, Samuel Thibault, 2016/01/13
- [hurd] 10/75: libihash: prefer performance degradation over failure, Samuel Thibault, 2016/01/13
- [hurd] 11/75: Make dde conditionally built under presence of libpciaccess, Samuel Thibault, 2016/01/13
- [hurd] 13/75: Clean debugging macro,
Samuel Thibault <=
- [hurd] 09/75: libihash: optimize lookup-or-insert operations, Samuel Thibault, 2016/01/13
- [hurd] 03/75: Remove unused variables, Samuel Thibault, 2016/01/13
- [hurd] 17/75: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd into dde, Samuel Thibault, 2016/01/13
- [hurd] 19/75: Add devnode documentation, Samuel Thibault, 2016/01/13
- [hurd] 23/75: Add missing menus, Samuel Thibault, 2016/01/13
- [hurd] 20/75: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd into dde, Samuel Thibault, 2016/01/13
- [hurd] 12/75: Merge branch 'dde' of ssh://git.savannah.gnu.org/srv/git/hurd/incubator into dde, Samuel Thibault, 2016/01/13
- [hurd] 02/75: libtrivfs: remove deprecated static class vectors, Samuel Thibault, 2016/01/13
- [hurd] 05/75: random: improve error handling, Samuel Thibault, 2016/01/13
- [hurd] 01/75: pfinet: fix sanity check at translator startup time, Samuel Thibault, 2016/01/13