- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit98e93a1
committed
Clean up messy API for src/port/thread.c.
The point of this patch is to reduce inclusion spam by not needingto #include <netdb.h> or <pwd.h> in port.h (which is read by everycompile in our tree). To do that, we must remove port.h'sdeclarations of pqGetpwuid and pqGethostbyname.pqGethostbyname is only used, and is only ever likely to be used,in src/port/getaddrinfo.c --- which isn't even built on mostplatforms, making pqGethostbyname dead code for most people.Hence, deal with that by just moving it into getaddrinfo.c.To clean up pqGetpwuid, invent a couple of simple wrapperfunctions with less-messy APIs. This allows removing someduplicate error-handling code, too.In passing, remove thread.c from the MSVC build, since itcontains nothing we use on Windows.Noted while working on376ce3e.Discussion:https://postgr.es/m/1634252654444.90107@mit.edu1 parent7fa945b commit98e93a1
File tree
11 files changed
+158
-110
lines changed- src
- backend/libpq
- bin/psql
- include
- interfaces/libpq
- port
- tools/msvc
11 files changed
+158
-110
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| 13 | + | |
13 | 14 |
| |
14 | 15 |
| |
15 | 16 |
| |
|
Lines changed: 3 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
18 |
| - | |
19 | 17 |
| |
20 | 18 |
| |
21 | 19 |
| |
| |||
484 | 482 |
| |
485 | 483 |
| |
486 | 484 |
| |
487 |
| - | |
| 485 | + | |
488 | 486 |
| |
489 |
| - | |
490 |
| - | |
| 487 | + | |
| 488 | + | |
491 | 489 |
| |
492 | 490 |
| |
493 |
| - | |
494 |
| - | |
495 |
| - | |
496 |
| - | |
497 |
| - | |
498 |
| - | |
499 | 491 |
| |
500 | 492 |
| |
501 | 493 |
| |
|
Lines changed: 29 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 |
| - | |
39 | 38 |
| |
40 | 39 |
| |
41 | 40 |
| |
| |||
1099 | 1098 |
| |
1100 | 1099 |
| |
1101 | 1100 |
| |
1102 |
| - | |
| 1101 | + | |
1103 | 1102 |
| |
1104 |
| - | |
1105 |
| - | |
1106 |
| - | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1107 | 1109 |
| |
1108 | 1110 |
| |
1109 |
| - | |
| 1111 | + | |
1110 | 1112 |
| |
1111 | 1113 |
| |
1112 | 1114 |
| |
| |||
1116 | 1118 |
| |
1117 | 1119 |
| |
1118 | 1120 |
| |
1119 |
| - | |
1120 | 1121 |
| |
1121 |
| - | |
1122 |
| - | |
1123 |
| - | |
1124 | 1122 |
| |
1125 | 1123 |
| |
1126 | 1124 |
| |
1127 | 1125 |
| |
1128 | 1126 |
| |
1129 |
| - | |
| 1127 | + | |
1130 | 1128 |
| |
1131 | 1129 |
| |
1132 | 1130 |
| |
| |||
1140 | 1138 |
| |
1141 | 1139 |
| |
1142 | 1140 |
| |
1143 |
| - | |
1144 |
| - | |
1145 |
| - | |
| 1141 | + | |
| 1142 | + | |
1146 | 1143 |
| |
1147 |
| - | |
1148 |
| - | |
1149 |
| - | |
1150 |
| - | |
1151 |
| - | |
1152 |
| - | |
1153 |
| - | |
1154 |
| - | |
1155 |
| - | |
1156 |
| - | |
1157 |
| - | |
| 1144 | + | |
1158 | 1145 |
| |
1159 | 1146 |
| |
1160 | 1147 |
| |
| |||
1170 | 1157 |
| |
1171 | 1158 |
| |
1172 | 1159 |
| |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1173 | 1177 |
| |
1174 | 1178 |
| |
1175 | 1179 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
|
Lines changed: 10 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2813 | 2813 |
| |
2814 | 2814 |
| |
2815 | 2815 |
| |
2816 |
| - | |
2817 |
| - | |
2818 |
| - | |
2819 |
| - | |
| 2816 | + | |
2820 | 2817 |
| |
2821 | 2818 |
| |
2822 | 2819 |
| |
| |||
2839 | 2836 |
| |
2840 | 2837 |
| |
2841 | 2838 |
| |
2842 |
| - | |
2843 |
| - | |
2844 |
| - | |
2845 |
| - | |
2846 |
| - | |
2847 |
| - | |
2848 |
| - | |
2849 |
| - | |
2850 |
| - | |
2851 |
| - | |
2852 |
| - | |
2853 |
| - | |
2854 |
| - | |
2855 |
| - | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
2856 | 2843 |
| |
2857 |
| - | |
| 2844 | + | |
2858 | 2845 |
| |
2859 | 2846 |
| |
2860 | 2847 |
| |
2861 |
| - | |
| 2848 | + | |
| 2849 | + | |
2862 | 2850 |
| |
2863 | 2851 |
| |
| 2852 | + | |
2864 | 2853 |
| |
2865 | 2854 |
| |
2866 | 2855 |
| |
| |||
7271 | 7260 |
| |
7272 | 7261 |
| |
7273 | 7262 |
| |
7274 |
| - | |
7275 |
| - | |
7276 |
| - | |
7277 |
| - | |
7278 |
| - | |
7279 |
| - | |
7280 |
| - | |
7281 |
| - | |
7282 |
| - | |
7283 |
| - | |
| 7263 | + | |
7284 | 7264 |
| |
7285 | 7265 |
| |
7286 | 7266 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
84 | 84 |
| |
85 | 85 |
| |
86 | 86 |
| |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 |
| |
88 | 92 |
| |
89 | 93 |
| |
|
Lines changed: 44 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
37 | 45 |
| |
38 | 46 |
| |
39 | 47 |
| |
| |||
394 | 402 |
| |
395 | 403 |
| |
396 | 404 |
| |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + |
Lines changed: 1 addition & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
815 | 815 |
| |
816 | 816 |
| |
817 | 817 |
| |
818 |
| - | |
819 |
| - | |
820 |
| - | |
821 |
| - | |
822 |
| - | |
823 |
| - | |
824 |
| - | |
825 |
| - | |
826 |
| - | |
827 |
| - | |
| 818 | + | |
828 | 819 |
| |
829 | 820 |
| |
830 | 821 |
| |
|
0 commit comments
Comments
(0)