forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5b0b699
committed
Refactor output file handling when forking syslogger under EXEC_BACKEND
A forked logging collector in EXEC_BACKEND builds passes down filedescriptors (or HANDLEs in WIN32) through a command for files to bereopened (for stderr and csvlog). Some of its logic was duplicated, andthis commit refactors the code with some wrapper routines for filereopening after forking and fd grabbing when building the command forthe fork.While on it, this simplifies a use of "long" in the code, introduced byab0ba6e to take care of a warning related to MinGW-W64 when mapping aintptr_t to a printed value. "long" is 32-bit long on Windows, andinteroperability of Win32 and Win64 ensures that handles are always32-bit significant, so we can just use "int" for the same result. Thisalso makes the new routines more symmetric.This change makes easier the introduction of new log destinations in thelogging collector, and this is not the only piece of refactoringplanned. I have tested this change with EXEC_BACKEND on linux, macos,and of course MSVC (both Win32 and Win64), but not MinGW so thebuildfarm may have something to say here.Author: Sehrope Sarkuni, Michael PaquierDiscussion:https://postgr.es/m/CAH7T-aqswBM6JWe4pDehi1uOiufqe06DJWaU5=X7dDLyqUExHg@mail.gmail.com1 parent6bc6bd4 commit5b0b699
1 file changed
+62
-60
lines changedLines changed: 62 additions & 60 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
130 | 130 |
| |
131 | 131 |
| |
132 | 132 |
| |
| 133 | + | |
| 134 | + | |
133 | 135 |
| |
134 | 136 |
| |
135 | 137 |
| |
| |||
733 | 735 |
| |
734 | 736 |
| |
735 | 737 |
| |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
736 | 792 |
| |
737 | 793 |
| |
738 | 794 |
| |
| |||
751 | 807 |
| |
752 | 808 |
| |
753 | 809 |
| |
754 |
| - | |
755 |
| - | |
756 |
| - | |
757 |
| - | |
758 |
| - | |
759 |
| - | |
760 |
| - | |
761 |
| - | |
762 |
| - | |
763 |
| - | |
764 |
| - | |
765 |
| - | |
766 |
| - | |
| 810 | + | |
| 811 | + | |
767 | 812 |
| |
768 |
| - | |
769 |
| - | |
770 |
| - | |
771 |
| - | |
772 |
| - | |
773 |
| - | |
774 |
| - | |
775 |
| - | |
776 |
| - | |
777 |
| - | |
778 |
| - | |
779 |
| - | |
780 |
| - | |
781 |
| - | |
| 813 | + | |
| 814 | + | |
782 | 815 |
| |
783 | 816 |
| |
784 | 817 |
| |
| |||
807 | 840 |
| |
808 | 841 |
| |
809 | 842 |
| |
810 |
| - | |
811 |
| - | |
812 |
| - | |
813 |
| - | |
814 |
| - | |
815 |
| - | |
816 |
| - | |
817 |
| - | |
818 |
| - | |
819 |
| - | |
820 |
| - | |
821 |
| - | |
822 |
| - | |
823 |
| - | |
824 | 843 |
| |
825 |
| - | |
826 |
| - | |
827 |
| - | |
828 |
| - | |
829 |
| - | |
830 |
| - | |
831 |
| - | |
832 |
| - | |
833 |
| - | |
| 844 | + | |
834 | 845 |
| |
835 |
| - | |
836 |
| - | |
837 |
| - | |
838 |
| - | |
839 |
| - | |
840 |
| - | |
841 |
| - | |
842 |
| - | |
843 |
| - | |
844 |
| - | |
| 846 | + | |
845 | 847 |
| |
846 | 848 |
| |
847 | 849 |
| |
|
0 commit comments
Comments
(0)