VirtualBox

Changeset 1785 in kBuild for trunk/src/kash/show.c


Ignore:
Timestamp:
Sep 14, 2008 5:31:16 PM (16 years ago)
Author:
bird
Message:

kash: fixed signals. trace all wrapped system calls.

File:
1 edited

Legend:

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

    r1233 r1785  
    284284{
    285285#ifdef DEBUG
     286        int savederrno = errno;
    286287        va_list va;
    287288
    288         if (debug(psh) != 1)
     289        if ((psh || !tracefile) && debug(psh) != 1)
    289290                return;
    290291        fprintf(tracefile, "[%d] ", sh_getpid(psh));
     
    292293        (void) vfprintf(tracefile, fmt, va);
    293294        va_end(va);
     295
     296        errno = savederrno;
    294297#endif
    295298}
     
    299302{
    300303#ifdef DEBUG
    301         if (debug(psh) != 1)
     304        int savederrno = errno;
     305
     306        if ((psh || !tracefile) && debug(psh) != 1)
    302307                return;
    303308        fprintf(tracefile, "[%d] ", sh_getpid(psh));
    304309        (void) vfprintf(tracefile, fmt, va);
     310
     311        errno = savederrno;
    305312#endif
    306313}
     
    311318trputs(shinstance *psh, const char *s)
    312319{
    313         if (debug(psh) != 1)
     320        int savederrno = errno;
     321
     322        if ((psh || !tracefile) && debug(psh) != 1)
    314323                return;
    315324        fputs(s, tracefile);
     325
     326        errno = savederrno;
    316327}
    317328
     
    320331trstring(shinstance *psh, char *s)
    321332{
     333        int savederrno = errno;
    322334        char *p;
    323335        char c;
    324336
    325         if (debug(psh) != 1)
     337        if ((psh || !tracefile) && debug(psh) != 1)
    326338                return;
    327339        putc('"', tracefile);
     
    354366        }
    355367        putc('"', tracefile);
     368
     369        errno = savederrno;
    356370}
    357371#endif
     
    362376{
    363377#ifdef DEBUG
    364         if (debug(psh) != 1)
     378        int savederrno = errno;
     379
     380        if ((psh || !tracefile) && debug(psh) != 1)
    365381                return;
    366382        while (*ap) {
     
    371387                        putc('\n', tracefile);
    372388        }
     389
     390        errno = savederrno;
    373391#endif
    374392}
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