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


Ignore:
Timestamp:
Sep 9, 2020, 10:01:39 PM (5 years ago)
Author:
bird
Message:

kash: Hammering on threaded mode.

File:
1 edited

Legend:

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

    r2423 r3438  
    299299
    300300        if (pos) {
    301         int     s = errno;
     301                int     s = errno;
    302302                char    prefix[40];
    303303                size_t  len;
    304304
    305                 len = sprintf(prefix, "[%d] ", sh_getpid(psh));
     305#ifdef SH_FORKED_MODE
     306                len = sprintf(prefix, "[%" SHPID_PRI "] ", sh_getpid(psh));
     307#else
     308                shpid pid = sh_getpid(psh);
     309                len = sprintf(prefix, "[%d/%d] ", SHPID_GET_PID(pid), SHPID_GET_TID(pid));
     310#endif
    306311                shfile_write(&psh->fdtab, psh->tracefd, prefix, len);
    307312                shfile_write(&psh->fdtab, psh->tracefd, psh->tracebuf, pos);
     
    310315                psh->tracebuf[0] = '\0';
    311316
    312         errno = s;
     317                errno = s;
    313318        }
    314319}
     
    359364                } else {
    360365                        /* it's too big for some reason... */
    361             int s = errno;
     366                        int s = errno;
    362367                        trace_flush(psh);
    363368                        shfile_write(&psh->fdtab, psh->tracefd, str, len);
    364369                        if (!flush_it)
    365370                                shfile_write(&psh->fdtab, psh->tracefd, "[too long]\n", sizeof( "[too long]\n") - 1);
    366             errno = s;
     371                        errno = s;
    367372                }
    368373
Note: See TracChangeset for help on using the changeset viewer.