Changeset 1080


Ignore:
Timestamp:
Jan 25, 2004, 11:33:36 PM (22 years ago)
Author:
bird
Message:

Removed dead filehandle code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/startup/startup.c

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r1079 r1080  
    1010#include <emx/startup.h>
    1111
    12 #if 0 /* dead */
    13 /* See app/iodata.c. */
    14 
    15 extern int _nfiles;
    16 extern int _files[];
    17 extern int _lookahead[];
    18 #endif
    19 
    2012extern int __crtinit1__;
    2113extern void __ctordtorInit1 (int *ptr);
    22 
    23 static void init_files (void);
    2414
    2515
     
    3626  startup_flag = 1;
    3727
    38 #if 0 /* moved to __init_dll() */
    39   /* Initialize the file handles. */
    40   init_files ();
    41 #endif
    42 
    4328  /* Initialize streams etc. if required. */
    4429  __ctordtorInit1 (&__crtinit1__);
     
    5439}
    5540
    56 
    57 #if 0 /* moved to __init_dll() */
    58 /* Initialize the file handles. */
    59 
    60 static void init_files (void)
    61 {
    62   int i, ht, fl;
    63 
    64   for (i = 0; i < _nfiles; ++i)
    65     {
    66       _files[i] = 0;
    67       _lookahead[i] = -1;
    68 
    69       /* Get the handle type.  If this fails, the handle is not open. */
    70 
    71       if (i < _io_ninherit && __ioctl2 (i, FGETHTYPE, (int)&ht) == 0)
    72         {
    73           /* init_streams() depends on _files[] being non-zero for
    74              open file handles.  When omitting O_TEXT, don't forget to
    75              set another bit. */
    76 
    77           _files[i] |= O_TEXT;
    78           if (HT_ISDEV (ht))
    79             _files[i] |= F_DEV;
    80           if (ht == HT_UPIPE || ht == HT_NPIPE)
    81             {
    82               _files[i] |= F_PIPE;
    83               fl = __fcntl (i, F_GETFL, 0);
    84               if (fl >= 0)
    85                 _files[i] |= fl & O_NDELAY;
    86             }
    87           switch (i)
    88             {
    89             case 0:
    90               _files[0] |= O_RDONLY;
    91               break;
    92 
    93             case 1:
    94             case 2:
    95               _files[i] |= O_WRONLY;
    96               break;
    97 
    98             default:
    99               /* All other handles can be read and written. */
    100               _files[i] |= O_RDWR;
    101               break;
    102             }
    103         }
    104     }
    105 }
    106 #endif
    10741
    10842
     
    173107 *          - exit() will call all the registered at_exit functions.
    174108 *          - exit() will call DosExit with the exit code and terminate the process.
     109 *
     110 * @todo update this with file handle changes!
    175111 */
Note: See TracChangeset for help on using the changeset viewer.