From 2ef91507719d9fc18461b7279b9b3da17c6e277f Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 29 Nov 2007 15:38:00 +0000 Subject: [PATCH] handle result of fwrite git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6434 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_console.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/switch_console.c b/src/switch_console.c index a2f4ac8e57..2516720cc4 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -36,10 +36,14 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_stream_raw_write(switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen) { + switch_size_t nwrite; FILE *out = switch_core_get_console(); if (out) { - fwrite(data, datalen, 1, out); + nwrite = fwrite(data, datalen, 1, out); + if (nwrite != datalen) { + return SWITCH_STATUS_FALSE; + } return SWITCH_STATUS_SUCCESS; }