comparison data/fileio/MP3FileReader.cpp @ 228:f02989f7e160

...
author Chris Cannam
date Mon, 12 Feb 2007 13:09:31 +0000
parents 06ad01f3e553
children b176e99f9c38
comparison
equal deleted inserted replaced
227:e919a2b97c2a 228:f02989f7e160
64 m_error = QString("Out of memory"); 64 m_error = QString("Out of memory");
65 ::close(fd); 65 ::close(fd);
66 return; 66 return;
67 } 67 }
68 68
69 if (::read(fd, filebuffer, stat.st_size) < stat.st_size) { 69 size_t sz = 0;
70 m_error = QString("Failed to read file %1.").arg(path); 70 if ((sz = ::read(fd, filebuffer, stat.st_size)) < stat.st_size) {
71 m_error = QString("Failed to read file %1 (expected %2 bytes, got %3 bytes).").arg(path).arg(stat.st_size).arg(sz);
71 delete[] filebuffer; 72 delete[] filebuffer;
72 ::close(fd); 73 ::close(fd);
73 return; 74 return;
74 } 75 }
75 76