Commit 9d6e4c2
committed
remove unnecessary workaround for fclose() on OpenBSD
proxychains-ng didn't call fclose() in a particular FILE on OpenBSD if a
test in the Makefile noticed that OpenBSD's fclose() called close() on
the underlying fd of the FILE.
The test hasn't worked for 8 years because an OpenBSD commit prevented
the test from overriding the libc close():
https://cvsweb.openbsd.org/src/lib/libc/stdio/fclose.c?rev=1.10&content-type=text/x-cvsweb-markup
>let internal calls resolve directly and not be overridable
For all this time, the workaround wasn't doing anything.
Additionally, behavior equivalent to calling close() on a fd is
mandatory in POSIX:
https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/
>The fclose() function shall perform the equivalent of a close()
>on the file descriptor
And finally, at least NetBSD 9.3 also uses the close() function to do
the same, but there's no workaround, and no reported misbehavior when
running on NetBSD to work around.
Even if the test did work, all the workaround appears to do is leak a
FILE.1 parent d5cc80a commit 9d6e4c2
2 files changed
+2
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | 223 | | |
227 | 224 | | |
228 | 225 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
564 | 563 | | |
565 | | - | |
566 | 564 | | |
567 | 565 | | |
568 | 566 | | |
| |||
639 | 637 | | |
640 | 638 | | |
641 | 639 | | |
642 | | - | |
| 640 | + | |
643 | 641 | | |
644 | 642 | | |
645 | 643 | | |
| |||
0 commit comments