summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorhunt <hunt>2006-04-08 21:59:36 +0000
committerhunt <hunt>2006-04-08 21:59:36 +0000
commita886ce75c650dcbefc56ba458ecbd568f945fb3b (patch)
tree0a269814834206950d4bf86ef10ba3767b84ee14 /runtime
parent35f5f0910846ea40cf5231584cc510a3ca3eda4f (diff)
downloadsystemtap-steved-a886ce75c650dcbefc56ba458ecbd568f945fb3b.tar.gz
systemtap-steved-a886ce75c650dcbefc56ba458ecbd568f945fb3b.tar.xz
systemtap-steved-a886ce75c650dcbefc56ba458ecbd568f945fb3b.zip
2006-04-08 Martin Hunt <hunt@redhat.com>
* librelay.c (stp_main_loop): Write with fwrite() instead of fputs() so we can write binary data.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/stpd/ChangeLog5
-rw-r--r--runtime/stpd/librelay.c15
2 files changed, 12 insertions, 8 deletions
diff --git a/runtime/stpd/ChangeLog b/runtime/stpd/ChangeLog
index 26b19c8f..21f8f2c9 100644
--- a/runtime/stpd/ChangeLog
+++ b/runtime/stpd/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-08 Martin Hunt <hunt@redhat.com>
+
+ * librelay.c (stp_main_loop): Write with fwrite() instead
+ of fputs() so we can write binary data.
+
2006-04-05 Martin Hunt <hunt@redhat.com>
* librelay.c (merge_output): Remove ANSI codes and write
warning to stderr.
diff --git a/runtime/stpd/librelay.c b/runtime/stpd/librelay.c
index d9968a41..47cb8bd6 100644
--- a/runtime/stpd/librelay.c
+++ b/runtime/stpd/librelay.c
@@ -753,19 +753,18 @@ int stp_main_loop(void)
switch (type) {
case STP_TRANSPORT_INFO:
{
- struct transport_info *info = (struct transport_info *)data;
-
+ struct transport_info *info = (struct transport_info *)data;
transport_mode = info->transport_mode;
params.subbuf_size = info->subbuf_size;
params.n_subbufs = info->n_subbufs;
#ifdef DEBUG
if (transport_mode == STP_TRANSPORT_RELAYFS)
- printf ("TRANSPORT_INFO recvd: RELAYFS %d bufs of %d bytes.\n",
- params.n_subbufs,
- params.subbuf_size);
+ fprintf (stderr, "TRANSPORT_INFO recvd: RELAYFS %d bufs of %d bytes.\n",
+ params.n_subbufs,
+ params.subbuf_size);
else
- printf ("TRANSPORT_INFO recvd: PROC with %d Mbyte buffers.\n",
- info->buf_size);
+ fprintf (stderr, "TRANSPORT_INFO recvd: PROC with %d Mbyte buffers.\n",
+ info->buf_size);
#endif
if (!streaming()) {
rc = init_relayfs();
@@ -789,7 +788,7 @@ int stp_main_loop(void)
break;
}
case STP_REALTIME_DATA:
- fputs ((char *)data, ofp);
+ fwrite_unlocked(data, nb - sizeof(int), 1, ofp);
break;
case STP_OOB_DATA:
fputs ((char *)data, stderr);