Changeset 279
- Timestamp:
- Jun 18, 2009, 6:03:07 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/lib/debug.c
r165 r279 574 574 else { 575 575 const char *p = strrchr_m( pname,'/' ); 576 if (!p) 577 p = strrchr_m( pname,'\\' ); 576 578 if (p) 577 579 pname = p + 1; … … 606 608 607 609 oldumask = umask( 022 ); 608 610 609 611 pstrcpy(fname, debugf ); 610 612 debugf[0] = '\0'; … … 619 621 620 622 pstrcpy( debugf, fname ); 621 new_dbf = x_fopen( debugf, O_WRONLY|O_APPEND|O_CREAT, 0644); 623 624 #ifdef __OS2__ 625 // YD we need to close the file before reopening, otherwise it is not 626 // possible to rename the log 627 if (dbf) { 628 (void) x_fclose(dbf); 629 dbf = NULL; 630 } 631 #endif 632 633 new_dbf = x_fopen( debugf, O_WRONLY|O_APPEND|O_CREAT, 0777); 622 634 623 635 if (!new_dbf) { … … 644 656 645 657 /* Take over stderr to catch ouput into logs */ 658 #ifndef __OS2__ 659 // this opens debug file twice! 646 660 if (dbf && sys_dup2(x_fileno(dbf), 2) == -1) { 647 661 close_low_fds(True); /* Close stderr too, if dup2 can't point it 648 662 at the logfile */ 649 663 } 664 #endif 650 665 651 666 return ret; … … 708 723 709 724 slprintf( name, sizeof(name)-1, "%s.old", debugf ); 725 #ifdef __OS2__ 726 (void)unlink( name ); 727 #endif 710 728 (void)rename( debugf, name ); 711 729 712 730 if (!reopen_logs()) { 713 731 /* We failed to reopen a log - continue using the old name. */
Note:
See TracChangeset
for help on using the changeset viewer.