The DEBUG macro enabled by --enable-debug is actually LIBGTOP_ENABLE_DEBUG.
This commit is contained in:
committed by
Robert Roth
parent
a3a16707b5
commit
a93dc2526d
@@ -52,7 +52,7 @@ glibtop_call_l (glibtop *server, unsigned command, size_t send_size,
|
|||||||
|
|
||||||
glibtop_read_l (server, sizeof (glibtop_response), &response);
|
glibtop_read_l (server, sizeof (glibtop_response), &response);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "RESPONSE: %lu - %d\n",
|
fprintf (stderr, "RESPONSE: %lu - %d\n",
|
||||||
response.offset, response.data_size);
|
response.offset, response.data_size);
|
||||||
#endif
|
#endif
|
||||||
|
16
lib/open.c
16
lib/open.c
@@ -47,7 +47,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
|
|||||||
|
|
||||||
server->error_method = GLIBTOP_ERROR_METHOD_DEFAULT;
|
server->error_method = GLIBTOP_ERROR_METHOD_DEFAULT;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "SIZEOF: %u - %u - %u - %u - %u - %u\n",
|
fprintf (stderr, "SIZEOF: %u - %u - %u - %u - %u - %u\n",
|
||||||
sizeof (glibtop_command), sizeof (glibtop_response),
|
sizeof (glibtop_command), sizeof (glibtop_response),
|
||||||
sizeof (glibtop_mountentry), sizeof (glibtop_union),
|
sizeof (glibtop_mountentry), sizeof (glibtop_union),
|
||||||
@@ -59,7 +59,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
|
|||||||
server->features = 0;
|
server->features = 0;
|
||||||
break;
|
break;
|
||||||
case GLIBTOP_METHOD_INET:
|
case GLIBTOP_METHOD_INET:
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "Connecting to '%s' port %ld.\n",
|
fprintf (stderr, "Connecting to '%s' port %ld.\n",
|
||||||
server->server_host, server->server_port);
|
server->server_host, server->server_port);
|
||||||
#endif
|
#endif
|
||||||
@@ -68,7 +68,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
|
|||||||
(server->server_host, server->server_port,
|
(server->server_host, server->server_port,
|
||||||
&server->socket);
|
&server->socket);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "Connect Type is %d.\n", connect_type);
|
fprintf (stderr, "Connect Type is %d.\n", connect_type);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -77,14 +77,14 @@ glibtop_open_l (glibtop *server, const char *program_name,
|
|||||||
server->features = -1;
|
server->features = -1;
|
||||||
break;
|
break;
|
||||||
case GLIBTOP_METHOD_UNIX:
|
case GLIBTOP_METHOD_UNIX:
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "Connecting to Unix Domain Socket.\n");
|
fprintf (stderr, "Connecting to Unix Domain Socket.\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect_type = glibtop_make_connection
|
connect_type = glibtop_make_connection
|
||||||
("unix", 0, &server->socket);
|
("unix", 0, &server->socket);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "Connect Type is %d.\n", connect_type);
|
fprintf (stderr, "Connect Type is %d.\n", connect_type);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
|
|||||||
server->features = -1;
|
server->features = -1;
|
||||||
break;
|
break;
|
||||||
case GLIBTOP_METHOD_PIPE:
|
case GLIBTOP_METHOD_PIPE:
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "Opening pipe to server (%s).\n",
|
fprintf (stderr, "Opening pipe to server (%s).\n",
|
||||||
LIBGTOP_SERVER);
|
LIBGTOP_SERVER);
|
||||||
#endif
|
#endif
|
||||||
@@ -165,7 +165,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
|
|||||||
|
|
||||||
memcpy (&server->sysdeps, &sysdeps, sizeof (glibtop_sysdeps));
|
memcpy (&server->sysdeps, &sysdeps, sizeof (glibtop_sysdeps));
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "Server features are %lu.\n",
|
fprintf (stderr, "Server features are %lu.\n",
|
||||||
server->features);
|
server->features);
|
||||||
#endif
|
#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
|
/* In any case, we call the open functions of our own sysdeps
|
||||||
* directory. */
|
* directory. */
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "Calling sysdeps open function.\n");
|
fprintf (stderr, "Calling sysdeps open function.\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@ glibtop_read_l (glibtop *server, size_t size, void *buf)
|
|||||||
int fd;
|
int fd;
|
||||||
glibtop_init_r (&server, 0, 0);
|
glibtop_init_r (&server, 0, 0);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "LIBRARY: really reading %d bytes.\n", (int)size);
|
fprintf (stderr, "LIBRARY: really reading %d bytes.\n", (int)size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ glibtop_read_data_l (glibtop *server)
|
|||||||
|
|
||||||
glibtop_init_r (&server, 0, 0);
|
glibtop_init_r (&server, 0, 0);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "LIBRARY: reading %lu data bytes.\n",
|
fprintf (stderr, "LIBRARY: reading %lu data bytes.\n",
|
||||||
(unsigned long) sizeof (size_t));
|
(unsigned long) sizeof (size_t));
|
||||||
#endif
|
#endif
|
||||||
@@ -50,7 +50,7 @@ glibtop_read_data_l (glibtop *server)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
glibtop_error_io_r (server, _("read data size"));
|
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",
|
fprintf (stderr, "LIBRARY: really reading %lu data bytes (ret = %d).\n",
|
||||||
(unsigned long) size, ret);
|
(unsigned long) size, ret);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -37,7 +37,7 @@ glibtop_write_l (glibtop *server, size_t size, void *buf)
|
|||||||
|
|
||||||
if (size == 0) return;
|
if (size == 0) return;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "LIBRARY: really writing %d bytes.\n", (int)size);
|
fprintf (stderr, "LIBRARY: really writing %d bytes.\n", (int)size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@ void
|
|||||||
do_output (int s, glibtop_response *resp, off_t offset,
|
do_output (int s, glibtop_response *resp, off_t offset,
|
||||||
size_t data_size, const void *data)
|
size_t data_size, const void *data)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "Really writing %d bytes at offset %lu.\n",
|
fprintf (stderr, "Really writing %d bytes at offset %lu.\n",
|
||||||
sizeof (glibtop_response), offset);
|
sizeof (glibtop_response), offset);
|
||||||
#endif
|
#endif
|
||||||
@@ -44,7 +44,7 @@ do_output (int s, glibtop_response *resp, off_t offset,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (resp->data_size) {
|
if (resp->data_size) {
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "Writing %d bytes of data.\n", resp->data_size);
|
fprintf (stderr, "Writing %d bytes of data.\n", resp->data_size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ do_read (int s, void *ptr, size_t total_size)
|
|||||||
tmp_ptr += nread;
|
tmp_ptr += nread;
|
||||||
ptr = tmp_ptr;
|
ptr = tmp_ptr;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "READ (%d): %d - %d - %d\n",
|
fprintf (stderr, "READ (%d): %d - %d - %d\n",
|
||||||
nread, already_read, remaining, total_size);
|
nread, already_read, remaining, total_size);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#ifndef PARENT_DEBUG
|
#ifndef PARENT_DEBUG
|
||||||
#define PARENT_DEBUG 1
|
#define PARENT_DEBUG 1
|
||||||
#endif
|
#endif
|
||||||
#ifndef DEBUG
|
#ifndef LIBGTOP_ENABLE_DEBUG
|
||||||
#define DEBUG 1
|
#define LIBGTOP_ENABLE_DEBUG 1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ glibtop_send_version (glibtop *server, int fd)
|
|||||||
|
|
||||||
size = strlen (buffer) + 1;
|
size = strlen (buffer) + 1;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "SERVER ID: |%s|\n", buffer);
|
fprintf (stderr, "SERVER ID: |%s|\n", buffer);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ glibtop_open_p (glibtop *server, const char *program_name,
|
|||||||
const unsigned long features,
|
const unsigned long features,
|
||||||
const unsigned flags)
|
const unsigned flags)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
|
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ glibtop_open_p (glibtop *server, const char *program_name,
|
|||||||
const unsigned flags)
|
const unsigned flags)
|
||||||
{
|
{
|
||||||
char errbuf[_POSIX2_LINE_MAX];
|
char errbuf[_POSIX2_LINE_MAX];
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
|
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ glibtop_open_p (glibtop *server, const char *program_name,
|
|||||||
const unsigned flags)
|
const unsigned flags)
|
||||||
{
|
{
|
||||||
char errbuf[_POSIX2_LINE_MAX];
|
char errbuf[_POSIX2_LINE_MAX];
|
||||||
#ifdef DEBUG
|
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||||
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
|
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user