/* In case ccan/io ever gets smart with non-blocking. */
if (errno == EAGAIN || errno == EWOULDBLOCK)
return 0;
- return -1;
+ /* If they can't handle the error, this will close conn! */
+ if (!io_get_extended_errors())
+ return -1;
}
*(int *)arg->u1.vp = fdin;
return 1;
* @arg: @next argument
*
* This creates a plan to receive a file descriptor, as sent by
- * io_send_fd. Once it's all read, the @next function will be called:
- * on an error, the finish function is called instead.
+ * io_send_fd. Once it's all read, the @next function will be called.
+ * On an error, if io_get_extended_errors() is true, then @next is called
+ * and @fd will be -1, otherwise the finish function is called.
*
* Note that the I/O may actually be done immediately.
*