Changeset 1785 in kBuild for trunk/src/kash/show.c
- Timestamp:
- Sep 14, 2008 5:31:16 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/show.c
r1233 r1785 284 284 { 285 285 #ifdef DEBUG 286 int savederrno = errno; 286 287 va_list va; 287 288 288 if ( debug(psh) != 1)289 if ((psh || !tracefile) && debug(psh) != 1) 289 290 return; 290 291 fprintf(tracefile, "[%d] ", sh_getpid(psh)); … … 292 293 (void) vfprintf(tracefile, fmt, va); 293 294 va_end(va); 295 296 errno = savederrno; 294 297 #endif 295 298 } … … 299 302 { 300 303 #ifdef DEBUG 301 if (debug(psh) != 1) 304 int savederrno = errno; 305 306 if ((psh || !tracefile) && debug(psh) != 1) 302 307 return; 303 308 fprintf(tracefile, "[%d] ", sh_getpid(psh)); 304 309 (void) vfprintf(tracefile, fmt, va); 310 311 errno = savederrno; 305 312 #endif 306 313 } … … 311 318 trputs(shinstance *psh, const char *s) 312 319 { 313 if (debug(psh) != 1) 320 int savederrno = errno; 321 322 if ((psh || !tracefile) && debug(psh) != 1) 314 323 return; 315 324 fputs(s, tracefile); 325 326 errno = savederrno; 316 327 } 317 328 … … 320 331 trstring(shinstance *psh, char *s) 321 332 { 333 int savederrno = errno; 322 334 char *p; 323 335 char c; 324 336 325 if ( debug(psh) != 1)337 if ((psh || !tracefile) && debug(psh) != 1) 326 338 return; 327 339 putc('"', tracefile); … … 354 366 } 355 367 putc('"', tracefile); 368 369 errno = savederrno; 356 370 } 357 371 #endif … … 362 376 { 363 377 #ifdef DEBUG 364 if (debug(psh) != 1) 378 int savederrno = errno; 379 380 if ((psh || !tracefile) && debug(psh) != 1) 365 381 return; 366 382 while (*ap) { … … 371 387 putc('\n', tracefile); 372 388 } 389 390 errno = savederrno; 373 391 #endif 374 392 }
Note:
See TracChangeset
for help on using the changeset viewer.