summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/ChangeLog5
-rw-r--r--runtime/print.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index 3ba747ae..5f877448 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-19 Martin Hunt <hunt@redhat.com>
+
+ * print.c (_stp_print_flush): Check return value and increment
+ transport failures.
+
2005-07-14 Frank Ch. Eigler <fche@redhat.com>
* builtin_functions.h (printk): Use explicit format string.
diff --git a/runtime/print.c b/runtime/print.c
index 1eb9934f..aa8a520d 100644
--- a/runtime/print.c
+++ b/runtime/print.c
@@ -77,7 +77,7 @@ void _stp_print_flush (void)
int cpu = smp_processor_id();
char *buf = &_stp_pbuf[cpu][0];
char *ptr = buf + STP_PRINT_BUF_START;
- int seq;
+ int ret, seq;
if (_stp_pbuf_len[cpu] == 0)
return;
@@ -85,7 +85,10 @@ void _stp_print_flush (void)
seq = _stp_seq_inc();
scnprintf (buf, TIMESTAMP_SIZE, "%10d", seq);
buf[TIMESTAMP_SIZE - 1] = ' ';
- _stp_transport_write(_stp_tport, buf, _stp_pbuf_len[cpu] + TIMESTAMP_SIZE + 1);
+ ret = _stp_transport_write(_stp_tport, buf, _stp_pbuf_len[cpu] + TIMESTAMP_SIZE + 1);
+ if (unlikely(ret < 0))
+ atomic_inc (&_stp_transport_failures);
+
_stp_pbuf_len[cpu] = 0;
*ptr = 0;
}