The DEBUG macro enabled by --enable-debug is actually LIBGTOP_ENABLE_DEBUG.

This commit is contained in:
Benoit Dejean
2015-02-28 00:20:28 +01:00
committed by Robert Roth
parent a3a16707b5
commit a93dc2526d
11 changed files with 22 additions and 22 deletions

View File

@@ -52,7 +52,7 @@ glibtop_call_l (glibtop *server, unsigned command, size_t send_size,
glibtop_read_l (server, sizeof (glibtop_response), &response);
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "RESPONSE: %lu - %d\n",
response.offset, response.data_size);
#endif

View File

@@ -47,7 +47,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
server->error_method = GLIBTOP_ERROR_METHOD_DEFAULT;
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "SIZEOF: %u - %u - %u - %u - %u - %u\n",
sizeof (glibtop_command), sizeof (glibtop_response),
sizeof (glibtop_mountentry), sizeof (glibtop_union),
@@ -59,7 +59,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
server->features = 0;
break;
case GLIBTOP_METHOD_INET:
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "Connecting to '%s' port %ld.\n",
server->server_host, server->server_port);
#endif
@@ -68,7 +68,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
(server->server_host, server->server_port,
&server->socket);
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "Connect Type is %d.\n", connect_type);
#endif
@@ -77,14 +77,14 @@ glibtop_open_l (glibtop *server, const char *program_name,
server->features = -1;
break;
case GLIBTOP_METHOD_UNIX:
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "Connecting to Unix Domain Socket.\n");
#endif
connect_type = glibtop_make_connection
("unix", 0, &server->socket);
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "Connect Type is %d.\n", connect_type);
#endif
@@ -93,7 +93,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
server->features = -1;
break;
case GLIBTOP_METHOD_PIPE:
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "Opening pipe to server (%s).\n",
LIBGTOP_SERVER);
#endif
@@ -165,7 +165,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
memcpy (&server->sysdeps, &sysdeps, sizeof (glibtop_sysdeps));
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "Server features are %lu.\n",
server->features);
#endif
@@ -174,7 +174,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
/* In any case, we call the open functions of our own sysdeps
* directory. */
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "Calling sysdeps open function.\n");
#endif

View File

@@ -33,7 +33,7 @@ glibtop_read_l (glibtop *server, size_t size, void *buf)
int fd;
glibtop_init_r (&server, 0, 0);
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "LIBRARY: really reading %d bytes.\n", (int)size);
#endif

View File

@@ -36,7 +36,7 @@ glibtop_read_data_l (glibtop *server)
glibtop_init_r (&server, 0, 0);
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "LIBRARY: reading %lu data bytes.\n",
(unsigned long) sizeof (size_t));
#endif
@@ -50,7 +50,7 @@ glibtop_read_data_l (glibtop *server)
if (ret < 0)
glibtop_error_io_r (server, _("read data size"));
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "LIBRARY: really reading %lu data bytes (ret = %d).\n",
(unsigned long) size, ret);
#endif

View File

@@ -37,7 +37,7 @@ glibtop_write_l (glibtop *server, size_t size, void *buf)
if (size == 0) return;
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "LIBRARY: really writing %d bytes.\n", (int)size);
#endif

View File

@@ -27,7 +27,7 @@ void
do_output (int s, glibtop_response *resp, off_t offset,
size_t data_size, const void *data)
{
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "Really writing %d bytes at offset %lu.\n",
sizeof (glibtop_response), offset);
#endif
@@ -44,7 +44,7 @@ do_output (int s, glibtop_response *resp, off_t offset,
}
if (resp->data_size) {
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "Writing %d bytes of data.\n", resp->data_size);
#endif
@@ -88,7 +88,7 @@ do_read (int s, void *ptr, size_t total_size)
tmp_ptr += nread;
ptr = tmp_ptr;
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "READ (%d): %d - %d - %d\n",
nread, already_read, remaining, total_size);
#endif

View File

@@ -26,8 +26,8 @@
#ifndef PARENT_DEBUG
#define PARENT_DEBUG 1
#endif
#ifndef DEBUG
#define DEBUG 1
#ifndef LIBGTOP_ENABLE_DEBUG
#define LIBGTOP_ENABLE_DEBUG 1
#endif
#endif

View File

@@ -42,7 +42,7 @@ glibtop_send_version (glibtop *server, int fd)
size = strlen (buffer) + 1;
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "SERVER ID: |%s|\n", buffer);
#endif

View File

@@ -52,7 +52,7 @@ glibtop_open_p (glibtop *server, const char *program_name,
const unsigned long features,
const unsigned flags)
{
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
#endif

View File

@@ -56,7 +56,7 @@ glibtop_open_p (glibtop *server, const char *program_name,
const unsigned flags)
{
char errbuf[_POSIX2_LINE_MAX];
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
#endif

View File

@@ -56,7 +56,7 @@ glibtop_open_p (glibtop *server, const char *program_name,
const unsigned flags)
{
char errbuf[_POSIX2_LINE_MAX];
#ifdef DEBUG
#ifdef LIBGTOP_ENABLE_DEBUG
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
#endif