forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdc227eb
committed
Add a build-time check that libpq doesn't call exit() or abort().
Directly exiting or aborting seems like poor form for a general-purposelibrary. Now that libpq liberally uses bits out of src/common/,it's very easy to accidentally include code that would do somethingunwanted like calling exit(1) after OOM --- see for example8ec00dc.Hence, add a simple cross-check that no such calls have made it intolibpq.so.The cross-check depends on nm(1) being available and being able towork on a shared library, which probably isn't true everywhere.But we can just make the test silently do nothing if nm fails.As long as the check is effective on common platforms, that shouldbe good enough. (By the same logic, I've not worried about providingan equivalent test in MSVC builds.)Discussion:https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us1 parentaaddf6b commitdc227eb
1 file changed
+8
-1
lines changedLines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
99 |
| - | |
| 99 | + | |
100 | 100 |
| |
101 | 101 |
| |
102 | 102 |
| |
103 | 103 |
| |
104 | 104 |
| |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
105 | 112 |
| |
106 | 113 |
| |
107 | 114 |
| |
|
0 commit comments
Comments
(0)