summaryrefslogtreecommitdiff
path: root/qmake/tools/qfile_unix.cpp
Unidiff
Diffstat (limited to 'qmake/tools/qfile_unix.cpp') (more/less context) (show whitespace changes)
-rw-r--r--qmake/tools/qfile_unix.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/qmake/tools/qfile_unix.cpp b/qmake/tools/qfile_unix.cpp
index 2d5a856..460bf06 100644
--- a/qmake/tools/qfile_unix.cpp
+++ b/qmake/tools/qfile_unix.cpp
@@ -437,7 +437,10 @@ QIODevice::Offset QFile::size() const
437 struct stat st; 437 struct stat st;
438 int ret = 0;
438 if ( isOpen() ) { 439 if ( isOpen() ) {
439 ::fstat( fh ? fileno(fh) : fd, &st ); 440 ret = ::fstat( fh ? fileno(fh) : fd, &st );
440 } else { 441 } else {
441 ::stat( QFile::encodeName(fn), &st ); 442 ret = ::stat( QFile::encodeName(fn), &st );
442 } 443 }
444 if ( ret == -1 )
445 return 0;
443#if defined(QT_LARGEFILE_SUPPORT) && !defined(QT_ABI_64BITOFFSET) 446#if defined(QT_LARGEFILE_SUPPORT) && !defined(QT_ABI_64BITOFFSET)
@@ -540,3 +543,3 @@ Q_LONG QFile::readBlock( char *p, Q_ULONG len )
540 while( nread < l ) { 543 while( nread < l ) {
541 *p = ungetchBuffer[ l - nread - 1 ]; 544 *p = ungetchBuffer.at( l - nread - 1 );
542 p++; 545 p++;
@@ -631,3 +634,5 @@ Q_LONG QFile::writeBlock( const char *p, Q_ULONG len )
631 This is a small positive integer, suitable for use with C library 634 This is a small positive integer, suitable for use with C library
632 functions such as fdopen() and fcntl(), as well as with QSocketNotifier. 635 functions such as fdopen() and fcntl(). On systems that use file
636 descriptors for sockets (ie. Unix systems, but not Windows) the handle
637 can be used with QSocketNotifier as well.
633 638