Changeset 948 for trunk/server/lib/util/debug.c
- Timestamp:
- Aug 11, 2016, 9:18:14 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/lib/util/debug.c
r946 r948 645 645 int maxlog; 646 646 struct stat st; 647 #ifdef __OS2__ 648 int force_trunc = 0; 649 #endif 647 650 648 651 /* … … 676 679 return; 677 680 } 681 #ifdef __OS2__ 682 /* Renaming an open file is not possible on 683 * OS/2 so we close it and then rename. Note 684 * that if this log file is also in use by 685 * another process, rename will still fail; in 686 * this case we fall back to simply truncating 687 * the current file to stop its growth. */ 688 debug_close_fd(state.fd); 689 state.fd = -1; 690 if (rename(state.debugf, name) == -1) { 691 /* Most likely, some other samba process 692 * is using this log file. In either case 693 * our only option is to truncate it. */ 694 force_trunc = 1; 695 } 696 if (reopen_logs_internal() && force_trunc) { 697 ftruncate(state.fd, 0); 698 } 699 #else 678 700 (void)rename(state.debugf, name); 679 701 … … 682 704 (void)rename(name, state.debugf); 683 705 } 706 #endif 684 707 SAFE_FREE(name); 685 708 }
Note:
See TracChangeset
for help on using the changeset viewer.