VirtualBox

Changeset 2296 in kBuild for trunk/src/kash/shfile.c


Ignore:
Timestamp:
Mar 1, 2009 1:54:30 AM (16 years ago)
Author:
bird
Message:

kash: avoid file steams in the trace code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shfile.c

    r2294 r2296  
    4343#endif
    4444
    45 #ifdef DEBUG
     45#if defined(DEBUG) && defined(TRACE_VIA_STDIO)
    4646extern FILE *tracefile;
    4747#endif
     
    150150        while (new_size < fdMin)
    151151            new_size += SHFILE_GROW;
    152         new_tab = sh_realloc(NULL, pfdtab->tab, new_size * sizeof(shfile));
     152        new_tab = sh_realloc(shthread_get_shell(), pfdtab->tab, new_size * sizeof(shfile));
    153153        if (new_tab)
    154154        {
    155             fd = i = pfdtab->size;
    156             if (fd < fdMin)
    157                 fd = fdMin;
    158155            for (i = pfdtab->size; i < new_size; i++)
    159156            {
     
    162159                new_tab[i].native = -1;
    163160            }
     161
     162            fd = pfdtab->size;
     163            if (fd < fdMin)
     164                fd = fdMin;
    164165
    165166            pfdtab->tab = new_tab;
     
    610611#endif
    611612
    612 #ifdef DEBUG
     613#if defined(DEBUG) && defined(TRACE_VIA_STDIO)
    613614    if (tracefile)
     615#endif
    614616        TRACE2((NULL, "shfile_open(%p:{%s}, %#x, 0%o) -> %d [%d]\n", name, name, flags, mode, fd, errno));
    615 #endif
    616617    return fd;
    617618}
     
    9991000
    10001001#ifdef DEBUG
     1002# ifdef TRACE_VIA_STDIO
    10011003    if (tracefile)
     1004# endif
    10021005        switch (cmd)
    10031006        {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette