Further fixes to file size handling on Windows with fd and FILE*
commit6b448660f0d967d2749a520b49aa6946e46bff6b
authorJoão Abecasis <joao@abecasis.name>
Wed, 4 Nov 2009 19:28:55 +0000 (4 20:28 +0100)
committerJoão Abecasis <joao@abecasis.name>
Wed, 4 Nov 2009 20:40:28 +0000 (4 21:40 +0100)
tree61920fcb63b40f8f4ada3f80e6b4dbb558f2ad5e
parent764d195bfa252775702bffc93989a35d0c19f035
Further fixes to file size handling on Windows with fd and FILE*

filelength is not available on Windows CE instead, we must fallback to
fseek/ftell as was being done previously.  Still on Windows CE, we still
don't report the file size for file descriptors, but we also won't set a
random error string.

Changed qt_error_string calls to use errno when errors come from CRT
functions.

Also, if we're using filelength on FILE* streams, there's no reason not
to use it for file descriptors, instead of requesting a native handle.

Reviewed-by: Olivier Goffart
src/corelib/io/qfsfileengine_win.cpp