forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit765f5df
committed
Improve WIN32 port of fstat() to detect more file types
The current implementation of _pgfstat64() is ineffective in detecting aterminal handle or an anonymous named pipe. This commit improves ourport of fstat() to detect more efficiently such cases by relying onGetFileType(), and returning more correct data when the type found iseither a FILE_TYPE_PIPE (_S_IFIFO) or a FILE_TYPE_CHAR (_S_IFCHR).This is part of a more global fix to address failures when feeding theoutput generated by pg_dump to pg_restore through a pipe, for example,but not all of it. We are also going to need to do something aboutfseek() and ftello() which are not reliable on WIN32 for the same caseswhere fstat() was incorrect. Fixing fstat() is independent of the rest,though, which is why both fixes are handled separately, and this is thefirst part of it.Reported-by: Daniel WatzingerAuthor: Daniel Watzinger, Juan José Santamaría FlechaDiscussion:https://postgr.es/m/b1448cd7-871e-20e3-8398-895e2d1d3bf9@gmail.comBackpatch-through: 141 parent89e46da commit765f5df
1 file changed
+49
-17
lines changedLines changed: 49 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
257 | 257 |
| |
258 | 258 |
| |
259 | 259 |
| |
260 |
| - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
261 | 263 |
| |
262 |
| - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
263 | 270 |
| |
264 | 271 |
| |
265 | 272 |
| |
266 | 273 |
| |
267 | 274 |
| |
| 275 | + | |
| 276 | + | |
| 277 | + | |
268 | 278 |
| |
269 |
| - | |
270 |
| - | |
271 |
| - | |
272 |
| - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
273 | 282 |
| |
274 |
| - | |
275 |
| - | |
276 |
| - | |
277 |
| - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
278 | 290 |
| |
279 |
| - | |
280 |
| - | |
281 |
| - | |
282 |
| - | |
283 |
| - | |
284 |
| - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
285 | 312 |
| |
286 | 313 |
| |
287 |
| - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
288 | 320 |
| |
289 | 321 |
| |
290 | 322 |
|
0 commit comments
Comments
(0)