- error(0, "abandoning writer %s because buffer has reached %td bytes",
- w->what, w->b.end - w->b.start);
- ev_fd_disable(w->ev, ev_write, w->fd);
- w->error = EPIPE;
- return ev_timeout(w->ev, 0, 0, writer_shutdown, w);
+ if(!w->abandoned) {
+ w->abandoned = 1;
+ error(0, "abandoning writer '%s' because buffer has reached %td bytes",
+ w->what, w->b.end - w->b.start);
+ ev_fd_disable(w->ev, ev_write, w->fd);
+ w->error = EPIPE;
+ return ev_timeout(w->ev, 0, 0, writer_shutdown, w);
+ } else
+ return 0;