ustream: suppress write attempts in ustream_printf and ustream_vprintf if a write error was flagged
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
975ac3e5e3
commit
84822fd6d5
1 changed files with 6 additions and 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);
|
||||
|
|
Loading…
Reference in a new issue