Changeset 1202 for trunk/src/kash/redir.c
- Timestamp:
- Oct 7, 2007, 2:24:15 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/redir.c
r1201 r1202 225 225 memory[fd] = 1; 226 226 else 227 copyfd( redir->ndup.dupfd, fd);227 copyfd(psh, redir->ndup.dupfd, fd); 228 228 } 229 229 INTON; … … 238 238 239 239 if (f != fd) { 240 copyfd( f, fd);241 close(f);240 copyfd(psh, f, fd); 241 shfile_close(&psh->fdtab, f); 242 242 } 243 243 INTON; … … 271 271 } 272 272 } 273 if (forkshell( (struct job *)NULL, (union node *)NULL, FORK_NOJOB) == 0) {273 if (forkshell(psh, (struct job *)NULL, (union node *)NULL, FORK_NOJOB) == 0) { 274 274 close(pip[0]); 275 275 signal(SIGINT, SIG_IGN); … … 307 307 if (i == 0) 308 308 fd0_redirected--; 309 close(i);309 shfile_close(&psh->fdtab, i); 310 310 if (rp->renamed[i] >= 0) { 311 copyfd( rp->renamed[i], i);312 close(rp->renamed[i]);311 copyfd(psh, rp->renamed[i], i); 312 shfile_close(&psh->fdtab, rp->renamed[i]); 313 313 } 314 314 } … … 330 330 RESET { 331 331 while (redirlist) 332 popredir( );332 popredir(psh); 333 333 } 334 334 335 335 SHELLPROC { 336 clearredir( 0);336 clearredir(psh, 0); 337 337 } 338 338 … … 341 341 /* Return true if fd 0 has already been redirected at least once. */ 342 342 int 343 fd0_redirected_p () {344 return fd0_redirected != 0;343 fd0_redirected_p(shinstance *psh) { 344 return psh->fd0_redirected != 0; 345 345 } 346 346 … … 376 376 377 377 int 378 copyfd( int from, int to)378 copyfd(shinstance *psh, int from, int to) 379 379 { 380 380 int newfd; 381 381 382 newfd = fcntl(from, F_DUPFD, to);382 newfd = shfile_fcntl(psh, from, F_DUPFD, to); 383 383 if (newfd < 0) { 384 384 if (errno == EMFILE)
Note:
See TracChangeset
for help on using the changeset viewer.