I'd missed out an if statement in the Unix proxy stderr code
introduced by commit
297efff30, causing ret->cmd_err to be passed to
uxsel_set even when it was -1 (which happened in the non-GUI tools).
Unfortunately, putting a negative fd into the uxsel tree has really
bad effects, because the first_fd / next_fd interface returns a
negative number to signal end-of-list - and since the uxsel tree is
sorted by fd, that happens _immediately_.
Added the missing if statement, and also an assertion to make sure we
never pass -1 to uxsel_set by mistake again!
add234(localproxy_by_errfd, ret);
uxsel_set(ret->from_cmd, 1, localproxy_select_result);
- uxsel_set(ret->cmd_err, 1, localproxy_select_result);
+ if (ret->cmd_err >= 0)
+ uxsel_set(ret->cmd_err, 1, localproxy_select_result);
/* We are responsible for this and don't need it any more */
sk_addr_free(addr);
{
struct fd *newfd;
+ assert(fd >= 0);
+
uxsel_del(fd);
if (rwx) {