Browse Source

libft: printer: discard buffer if write fails

emartine
Elouan Martinet 2 years ago
parent
commit
f7fde6abd0
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libft/printer/printer_flush.c

+ 3
- 0
libft/printer/printer_flush.c View File

@ -25,7 +25,10 @@ void printer_flush(t_printer *handle)
{
r = write(handle->fd, handle->buffer + i, handle->length - i);
if (r <= 0)
{
handle->length = 0;
break ;
}
i += r;
}
handle->length = 0;


Loading…
Cancel
Save