-static int file_write_post_select(struct sched *s, struct writer_node *wn)
-{
- struct private_file_write_data *pfwd = wn->private_data;
- struct writer_node_group *wng = wn->wng;
- int ret;
-
- if (!pfwd->check_fd)
- return 1;
- if (*wng->loaded <= wn->written)
- return 1;
- if (!FD_ISSET(pfwd->fd, &s->wfds))
- return 1;
-// PARA_INFO_LOG("writing %zd\n", *wng->loaded);
- ret = write(pfwd->fd, *wng->bufp + wn->written,
- *wng->loaded - wn->written);
- if (ret < 0)
- return -E_FW_WRITE;
- wn->written += ret;
- return 1;
+ if (ret == 0)
+ return;
+ if (ret < 0 || !pfwd)
+ return sched_min_delay(s);
+ para_fd_set(pfwd->fd, &s->wfds, &s->max_fileno);