summaryrefslogtreecommitdiff
path: root/lib/open.c
diff options
context:
space:
mode:
authorMartin Baulig <martin@src.gnome.org>1998-10-03 03:01:22 +0000
committerMartin Baulig <martin@src.gnome.org>1998-10-03 03:01:22 +0000
commitbe63bf2d42aebffadd62cb418d767f72ac245c62 (patch)
tree3c6e4dc3bc7c22ce2bac278749e098643c402465 /lib/open.c
parent06d907146d1c3fe6ef448625ea1eef11fdfb7398 (diff)
downloadlibgtop-be63bf2d42aebffadd62cb418d767f72ac245c62.tar.gz
Enclosed some debugging statements in `#ifdef DEBUG'.
Diffstat (limited to 'lib/open.c')
-rw-r--r--lib/open.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/open.c b/lib/open.c
index f3716071..75204731 100644
--- a/lib/open.c
+++ b/lib/open.c
@@ -57,34 +57,44 @@ glibtop_open_l (glibtop *server, const char *program_name,
server->features = 0;
break;
case GLIBTOP_METHOD_INET:
+#ifdef DEBUG
fprintf (stderr, "Connecting to '%s' port %ld.\n",
server->server_host, server->server_port);
+#endif
connect_type = glibtop_make_connection
(server->server_host, server->server_port,
&server->socket);
+#ifdef DEBUG
fprintf (stderr, "Connect Type is %d.\n", connect_type);
+#endif
server->flags |= _GLIBTOP_INIT_STATE_SERVER;
server->features = -1;
break;
case GLIBTOP_METHOD_UNIX:
+#ifdef DEBUG
fprintf (stderr, "Connecting to Unix Domain Socket.\n");
+#endif
connect_type = glibtop_make_connection
("unix", 0, &server->socket);
-
+
+#ifdef DEBUG
fprintf (stderr, "Connect Type is %d.\n", connect_type);
+#endif
server->flags |= _GLIBTOP_INIT_STATE_SERVER;
server->features = -1;
break;
case GLIBTOP_METHOD_PIPE:
+#ifdef DEBUG
fprintf (stderr, "Opening pipe to server (%s).\n",
LIBGTOP_SERVER);
+#endif
if (pipe (server->input) || pipe (server->output))
glibtop_error_io_r (server, "cannot make a pipe");
@@ -153,14 +163,18 @@ glibtop_open_l (glibtop *server, const char *program_name,
memcpy (&server->sysdeps, &sysdeps, sizeof (glibtop_sysdeps));
+#ifdef DEBUG
fprintf (stderr, "Server features are %lu.\n",
server->features);
+#endif
}
/* In any case, we call the open functions of our own sysdeps
* directory. */
+#ifdef DEBUG
fprintf (stderr, "Calling sysdeps open function.\n");
+#endif
glibtop_init_s (&server, features, flags);
}