Changeset 2293 for trunk/src/kash/show.c


Ignore:
Timestamp:
Feb 28, 2009, 8:25:12 AM (16 years ago)
Author:
bird
Message:

kash: forking on windows (almost there).

File:
1 edited

Legend:

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

    r2289 r2293  
    274274trputc(shinstance *psh, int c)
    275275{
    276         if (debug(psh) != 1)
     276        if (psh && debug(psh) != 1)
    277277                return;
    278278        putc(c, tracefile);
     
    287287        va_list va;
    288288
    289         if ((psh || !tracefile) && debug(psh) != 1)
    290                 return;
    291         fprintf(tracefile, "[%d] ", sh_getpid(psh));
     289        if (!tracefile || (psh && debug(psh) != 1))
     290                return;
     291        fprintf(tracefile, "[%d] ", sh_getpid(psh));
    292292        va_start(va, fmt);
    293293        (void) vfprintf(tracefile, fmt, va);
     
    304304        int savederrno = errno;
    305305
    306         if ((psh || !tracefile) && debug(psh) != 1)
    307                 return;
    308         fprintf(tracefile, "[%d] ", sh_getpid(psh));
     306        if (!tracefile || (psh && debug(psh) != 1))
     307                return;
     308        fprintf(tracefile, "[%d] ", sh_getpid(psh));
    309309        (void) vfprintf(tracefile, fmt, va);
    310310
     
    320320        int savederrno = errno;
    321321
    322         if ((psh || !tracefile) && debug(psh) != 1)
     322        if (!tracefile || (psh && debug(psh) != 1))
    323323                return;
    324324        fputs(s, tracefile);
     
    335335        char c;
    336336
    337         if ((psh || !tracefile) && debug(psh) != 1)
     337        if (!tracefile || (psh && debug(psh) != 1))
    338338                return;
    339339        putc('"', tracefile);
     
    378378        int savederrno = errno;
    379379
    380         if ((psh || !tracefile) && debug(psh) != 1)
     380        if (!tracefile || (psh && debug(psh) != 1))
    381381                return;
    382382        while (*ap) {
     
    400400        int fd;
    401401
    402         if (debug(psh) != 1) {
     402        if (psh && debug(psh) != 1) {
    403403                if (tracefile)
    404404                        fflush(tracefile);
Note: See TracChangeset for help on using the changeset viewer.