Lines Matching refs:redir
1210 struct redir_struct *redir; local
1212 for (redir=prog->redirects; redir; redir=redir->next) {
1213 if (redir->dup == -1 && redir->word.gl_pathv == NULL) {
1217 if (redir->dup == -1) {
1218 mode=redir_table[redir->type].mode;
1219 openfd = open(redir->word.gl_pathv[0], mode, 0666);
1223 perror_msg("error opening %s", redir->word.gl_pathv[0]);
1227 openfd = redir->dup;
1230 if (openfd != redir->fd) {
1231 if (squirrel && redir->fd < 3) {
1232 squirrel[redir->fd] = dup(redir->fd);
1237 dup2(openfd, redir->fd);
1238 if (redir->dup == -1)
2301 struct redir_struct *redir = child->redirects; local
2305 while(redir) {
2306 last_redir=redir;
2307 redir=redir->next;
2309 redir = xmalloc(sizeof(struct redir_struct));
2310 redir->next=NULL;
2311 redir->word.gl_pathv=NULL;
2313 last_redir->next=redir;
2315 child->redirects=redir;
2318 redir->type=style;
2319 redir->fd= (fd==-1) ? redir_table[style].default_fd : fd ;
2321 debug_printf("Redirect type %d%s\n", redir->fd, redir_table[style].descrip);
2324 redir->dup = redirect_dup_num(input);
2325 if (redir->dup == -2) return 1; /* syntax error */
2326 if (redir->dup != -1) {
2330 debug_printf("Duplicating redirect '%d>&%d'\n", redir->fd, redir->dup);
2337 ctx->pending_redirect = redir;