Commit dcb34b5
Make bzip2 unit tests pass on musl-based systems
Other than glibc, the musl standard C library does not check the
validity of file descriptors passed to `fdopen()`, so the constructor
of the (de)compressor does not throw an excption on musl-based systems.
Rather, an exception is thrown later, when the opened file is being used.
According to the musl team, the current musl behavior conforms to the POSIX
specification, and application code should be made agnostic to whether
or not the standard C library happens to validate file descriptors
passed to `fdopen()`.
For the discussion of `fdopen()` filedescriptor validation, see this
thread on the musl mailing list:
* https://www.openwall.com/lists/musl/2022/08/04/1
* https://www.openwall.com/lists/musl/2022/08/04/2
* https://www.openwall.com/lists/musl/2022/08/04/3
After this change, all libosmium tests (including those for bzip2) are
passing on Alpine Linux, which uses musl as its standard C library.
Fixes #353.1 parent 73d3594 commit dcb34b5
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | | - | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
16 | | - | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
96 | 108 | | |
97 | | - | |
| 109 | + | |
98 | 110 | | |
99 | 111 | | |
100 | 112 | | |
101 | 113 | | |
102 | | - | |
| 114 | + | |
103 | 115 | | |
104 | 116 | | |
105 | 117 | | |
| |||
0 commit comments