Commit 4afebf1
authored
refactor: popen and pclose error reporting
* Set errno for popen and pclose for WIN32 just like POSIX does
(at least mingw64+wine seems to decode the error message without doing anything extra)
* A work around for popen/pclose: complicated but works
* Refactored popen/pclose into custom implementation and added c++ wrappers
* Removed exceptions and cleaned up process pipe api
* Refactored popen/pclose into C++ class
* Fixed trivial issues for Linux
* Simplified the move semantics by avoiding virtual functions
* Moved error reporting into common_pipe
* Simplified open and close in case the pipe is already opened/closed
* Fixed error handling for MSVC, which very weird:
MSVC rejects strerror, suggest to use "secure" strerror_s, but then does not supply strerrorlen_s
GCC does not provide strerror_s, looks like strerror is good enough there.
* MSVC is not following any standards1 parent e4ce497 commit 4afebf1
File tree
5 files changed
+354
-144
lines changed- source/matplot
- backend
- util
5 files changed
+354
-144
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
73 | 75 | | |
74 | | - | |
| 76 | + | |
75 | 77 | | |
76 | | - | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
| |||
281 | 280 | | |
282 | 281 | | |
283 | 282 | | |
284 | | - | |
285 | | - | |
| 283 | + | |
286 | 284 | | |
287 | 285 | | |
288 | 286 | | |
| |||
294 | 292 | | |
295 | 293 | | |
296 | 294 | | |
297 | | - | |
| 295 | + | |
298 | 296 | | |
299 | 297 | | |
300 | | - | |
| 298 | + | |
301 | 299 | | |
302 | 300 | | |
303 | 301 | | |
304 | 302 | | |
305 | 303 | | |
306 | | - | |
| 304 | + | |
307 | 305 | | |
308 | | - | |
309 | | - | |
| 306 | + | |
| 307 | + | |
310 | 308 | | |
311 | 309 | | |
312 | 310 | | |
| |||
323 | 321 | | |
324 | 322 | | |
325 | 323 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
331 | 327 | | |
332 | 328 | | |
333 | 329 | | |
| |||
337 | 333 | | |
338 | 334 | | |
339 | 335 | | |
340 | | - | |
341 | | - | |
342 | | - | |
| 336 | + | |
| 337 | + | |
343 | 338 | | |
344 | 339 | | |
345 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
119 | | - | |
| 119 | + | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 53 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
73 | 57 | | |
74 | 58 | | |
75 | 59 | | |
| |||
0 commit comments