diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-12-30 18:46:18 +0400 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-12-30 18:46:18 +0400 |
commit | 84822fd6d529abc35bf8023403d547f8001bf5f3 (patch) | |
tree | 15ead7e8c0fd5f52771e7d45de1dc624997117c4 /ustream.c | |
parent | 975ac3e5e30f1106b6b4ea69c8cbf10c7ce8483e (diff) |
ustream: suppress write attempts in ustream_printf and ustream_vprintf if a write error was flagged
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'ustream.c')
-rw-r--r-- | ustream.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -435,6 +435,9 @@ int ustream_vprintf(struct ustream *s, const char *format, va_list arg) va_list arg2; int wr, maxlen, buflen; + if (s->write_error) + return 0; + if (!l->data_bytes) { buf = alloca(MAX_STACK_BUFLEN); va_copy(arg2, arg); @@ -493,6 +496,9 @@ int ustream_printf(struct ustream *s, const char *format, ...) va_list arg; int ret; + if (s->write_error) + return 0; + va_start(arg, format); ret = ustream_vprintf(s, format, arg); va_end(arg); |