1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: init.c |
2 | * File: init.c |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * $Id: init.C,v 1.6 2003/11/25 17:11:33 pcg Exp $ |
4 | * $Id: init.C,v 1.7 2003/11/26 10:42:34 pcg Exp $ |
5 | * |
5 | * |
6 | * All portions of code are copyright by their respective author/s. |
6 | * All portions of code are copyright by their respective author/s. |
7 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
7 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
8 | * - original version |
8 | * - original version |
9 | * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> |
9 | * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> |
… | |
… | |
473 | } else if (i > STDIN_FILENO) { |
473 | } else if (i > STDIN_FILENO) { |
474 | dup2(i, STDIN_FILENO); |
474 | dup2(i, STDIN_FILENO); |
475 | close(i); |
475 | close(i); |
476 | } |
476 | } |
477 | dup2(STDERR_FILENO, STDOUT_FILENO); |
477 | dup2(STDERR_FILENO, STDOUT_FILENO); |
|
|
478 | #if 0 // schmorp sayz closing filies is murder |
478 | for (i = STDERR_FILENO + 1; i < R->num_fds; i++) { |
479 | for (i = STDERR_FILENO + 1; i < R->num_fds; i++) { |
479 | #ifdef __sgi /* Alex Coventry says we need 4 & 7 too */ |
480 | #ifdef __sgi /* Alex Coventry says we need 4 & 7 too */ |
480 | if (i == 4 || i == 7) |
481 | if (i == 4 || i == 7) |
481 | continue; |
482 | continue; |
482 | #endif |
483 | #endif |
483 | close(i); |
484 | close(i); |
484 | } |
485 | } |
|
|
486 | #endif |
485 | } |
487 | } |
486 | |
488 | |
487 | /*----------------------------------------------------------------------*/ |
489 | /*----------------------------------------------------------------------*/ |
488 | /* EXTPROTO */ |
490 | /* EXTPROTO */ |
489 | const char ** |
491 | const char ** |