summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <martin@src.gnome.org>1998-07-13 00:18:44 +0000
committerMartin Baulig <martin@src.gnome.org>1998-07-13 00:18:44 +0000
commitf30dfecaf7c284f358fb1cb00a2da296ec4e6738 (patch)
treec344551d813837e957b500bc36c7d9c0dde5250e
parent8a666eb5a4e3d534f1266879ff4d3f231f4f0fa7 (diff)
downloadlibgtop-f30dfecaf7c284f358fb1cb00a2da296ec4e6738.tar.gz
Changed indentation, removed some lines already commented out.
Enclosed debugging statement in '#ifdef DEBUG'.
-rw-r--r--lib/command.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/command.c b/lib/command.c
index abef8bcd..b9d927c3 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -27,8 +27,8 @@
#include <glibtop/xmalloc.h>
void *
-glibtop_call_l (glibtop *server, unsigned command, size_t send_size, void *send_buf,
- size_t recv_size, void *recv_buf)
+glibtop_call_l (glibtop *server, unsigned command, size_t send_size,
+ void *send_buf, size_t recv_size, void *recv_buf)
{
glibtop_command cmnd;
glibtop_response response;
@@ -45,11 +45,6 @@ glibtop_call_l (glibtop *server, unsigned command, size_t send_size, void *send_
* send it together with command, so we only need one system call instead
* of two. */
-#ifdef DEBUG
- // fprintf (stderr, "COMMAND: send_size = %d; command = %d; sizeof (cmnd) = %d\n",
- // send_size, command, sizeof (glibtop_command));
-#endif
-
if (send_size <= _GLIBTOP_PARAM_SIZE) {
memcpy (cmnd.parameter, send_buf, send_size);
cmnd.size = send_size;
@@ -58,14 +53,17 @@ glibtop_call_l (glibtop *server, unsigned command, size_t send_size, void *send_
}
glibtop_write_l (server, sizeof (glibtop_command), &cmnd);
- // glibtop_write_l (server, cmnd.data_size, send_buf);
glibtop_read_l (server, sizeof (glibtop_response), &response);
- fprintf (stderr, "RESPONSE: %d - %d\n", response.offset, response.data_size);
+#ifdef DEBUG
+ fprintf (stderr, "RESPONSE: %d - %d\n",
+ response.offset, response.data_size);
+#endif
if (recv_buf)
- memcpy (recv_buf, ((char *) &response) + response.offset, recv_size);
+ memcpy (recv_buf, ((char *) &response) + response.offset,
+ recv_size);
if (response.data_size) {
void *ptr = glibtop_malloc_r (server, response.data_size);