Changeset 3438 for trunk/src/kash/show.c
- Timestamp:
- Sep 9, 2020, 10:01:39 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/show.c
r2423 r3438 299 299 300 300 if (pos) { 301 301 int s = errno; 302 302 char prefix[40]; 303 303 size_t len; 304 304 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 306 311 shfile_write(&psh->fdtab, psh->tracefd, prefix, len); 307 312 shfile_write(&psh->fdtab, psh->tracefd, psh->tracebuf, pos); … … 310 315 psh->tracebuf[0] = '\0'; 311 316 312 317 errno = s; 313 318 } 314 319 } … … 359 364 } else { 360 365 /* it's too big for some reason... */ 361 366 int s = errno; 362 367 trace_flush(psh); 363 368 shfile_write(&psh->fdtab, psh->tracefd, str, len); 364 369 if (!flush_it) 365 370 shfile_write(&psh->fdtab, psh->tracefd, "[too long]\n", sizeof( "[too long]\n") - 1); 366 371 errno = s; 367 372 } 368 373
Note:
See TracChangeset
for help on using the changeset viewer.