diff options
author | hunt <hunt> | 2006-04-08 21:59:36 +0000 |
---|---|---|
committer | hunt <hunt> | 2006-04-08 21:59:36 +0000 |
commit | a886ce75c650dcbefc56ba458ecbd568f945fb3b (patch) | |
tree | 0a269814834206950d4bf86ef10ba3767b84ee14 /runtime/stpd/librelay.c | |
parent | 35f5f0910846ea40cf5231584cc510a3ca3eda4f (diff) | |
download | systemtap-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/stpd/librelay.c')
-rw-r--r-- | runtime/stpd/librelay.c | 15 |
1 files changed, 7 insertions, 8 deletions
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); |