Lines Matching refs:redir
1209 struct redir_struct *redir; local
1211 for (redir=prog->redirects; redir; redir=redir->next) {
1212 if (redir->dup == -1 && redir->word.gl_pathv == NULL) {
1216 if (redir->dup == -1) {
1217 mode=redir_table[redir->type].mode;
1218 openfd = open(redir->word.gl_pathv[0], mode, 0666);
1222 perror_msg("error opening %s", redir->word.gl_pathv[0]);
1226 openfd = redir->dup;
1229 if (openfd != redir->fd) {
1230 if (squirrel && redir->fd < 3) {
1231 squirrel[redir->fd] = dup(redir->fd);
1236 dup2(openfd, redir->fd);
1237 if (redir->dup == -1)
2300 struct redir_struct *redir = child->redirects; local
2304 while(redir) {
2305 last_redir=redir;
2306 redir=redir->next;
2308 redir = xmalloc(sizeof(struct redir_struct));
2309 redir->next=NULL;
2310 redir->word.gl_pathv=NULL;
2312 last_redir->next=redir;
2314 child->redirects=redir;
2317 redir->type=style;
2318 redir->fd= (fd==-1) ? redir_table[style].default_fd : fd ;
2320 debug_printf("Redirect type %d%s\n", redir->fd, redir_table[style].descrip);
2323 redir->dup = redirect_dup_num(input);
2324 if (redir->dup == -2) return 1; /* syntax error */
2325 if (redir->dup != -1) {
2329 debug_printf("Duplicating redirect '%d>&%d'\n", redir->fd, redir->dup);
2336 ctx->pending_redirect = redir;