forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6563fb2
committed
Fix fd.c to preserve errno where needed.
PathNameOpenFile failed to ensure that the correct value of errno wasreturned to its caller after a failure (because it incorrectly supposedthat free() can never change errno). In some cases this would resultin a user-visible failure because an expected ENOENT errno was replacedwith something else. Bogus EINVAL failures have been observed on OS X,for example.There were also a couple of places that could mangle an important valueof errno if FDDEBUG was defined. While the usefulness of that debugsupport is highly debatable, we might as well make it safe to use,so add errno save/restore logic to the DO_DB macro.Per bug #8167 from Nelson Minar, diagnosed by RhodiumToad.Back-patch to all supported branches.1 parente7bfc7e commit6563fb2
1 file changed
+13
-5
lines changedLines changed: 13 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
131 |
| - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
132 | 137 |
| |
133 |
| - | |
| 138 | + | |
| 139 | + | |
134 | 140 |
| |
135 | 141 |
| |
136 | 142 |
| |
| |||
703 | 709 |
| |
704 | 710 |
| |
705 | 711 |
| |
706 |
| - | |
| 712 | + | |
707 | 713 |
| |
708 | 714 |
| |
709 | 715 |
| |
| |||
754 | 760 |
| |
755 | 761 |
| |
756 | 762 |
| |
757 |
| - | |
| 763 | + | |
758 | 764 |
| |
759 | 765 |
| |
760 | 766 |
| |
| |||
911 | 917 |
| |
912 | 918 |
| |
913 | 919 |
| |
| 920 | + | |
| 921 | + | |
914 | 922 |
| |
915 | 923 |
| |
| 924 | + | |
916 | 925 |
| |
917 | 926 |
| |
918 | 927 |
| |
| |||
1554 | 1563 |
| |
1555 | 1564 |
| |
1556 | 1565 |
| |
1557 |
| - | |
1558 | 1566 |
| |
1559 | 1567 |
| |
1560 | 1568 |
| |
|
0 commit comments
Comments
(0)