Lines Matching refs:indirect
171 if (!state.indirect.con && state.home->idle)
237 if (state.indirect.con)
521 else if (state.indirect.con)
535 if (state.indirect.con && (state.con[fd].info.user.flags & (USER_IDENT|USER_INIT)) == USER_IDENT)
543 if (state.indirect.con)
575 if (state.indirect.con) s += sfsprintf(s, state.buflen - (s - state.buf), ",%s", CO_OPT_INDIRECT);
733 * indirect coshell initialization
737 indirect(void* handle, int fdmax)
744 csfd(state.indirect.con, CS_POLL_READ);
745 pass[state.indirect.con] = state.indirect.msg;
746 csfd(state.indirect.cmd, CS_POLL_READ);
747 pass[state.indirect.cmd] = state.indirect.con;
752 * indirect coshell data pump
767 *pass = pd == 1 ? state.indirect.out : state.indirect.err;
773 if (fd == state.indirect.cmd) exit(0);
845 if (!strmatch(s, "/dev/fdp/*")) state.indirect.con = 1;
887 if (!state.indirect.con)
893 else if (!(s = getenv(CO_ENV_MSGFD)) || (state.indirect.msg = (int)strtol(s, &t, 0)) <= 0 || *t)
894 state.indirect.msg = i - 1;
895 fds[i - 1] = state.indirect.msg;
899 if ((state.indirect.con || !cssend(fd, fds, i)) && csread(fd, s, 7, CS_EXACT) == 7 && s[0] == '#' && !(errno = (int)strtol(s + 1, NiL, 10))) do
901 if (state.indirect.con)
910 if (state.indirect.con)
932 if (state.indirect.con)
935 if ((n = (int)strtol(s + 1, NiL, 10)) == 1) state.indirect.out = fds[0];
936 else if (n == 2) state.indirect.err = fds[0];
939 state.indirect.con = pfd;
943 if ((state.indirect.cmd = dup(0)) < 0) break;
947 csfd(state.indirect.cmd, 0);
948 csfd(state.indirect.con = fd, 0);
949 csfd(state.indirect.out = 1, 0);
950 csfd(state.indirect.err = 2, 0);
951 csfd(state.indirect.msg, 0);
952 csserve(NiL, NiL, indirect, NiL, NiL, pump, NiL, NiL);