From: Mika Isojärvi Date: Mon, 2 Nov 2015 22:26:28 +0000 (-0800) Subject: Fix deFile_getSize. X-Git-Tag: upstream/0.1.0~1354 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b3904dfb79ddbb71988439d3604ed32d17daf8c;p=platform%2Fupstream%2FVK-GL-CTS.git Fix deFile_getSize. Seek to the end of the file instead of second last byte of the file. Change-Id: I2cdb6db50d4b0d3b73ea83edfedaf1645b766808 --- diff --git a/framework/delibs/deutil/deFile.c b/framework/delibs/deutil/deFile.c index 3cd1265..1587a1d 100644 --- a/framework/delibs/deutil/deFile.c +++ b/framework/delibs/deutil/deFile.c @@ -164,10 +164,11 @@ deInt64 deFile_getSize (const deFile* file) if (curPos < 0) return -1; - if (lseek(file->fd, -1, SEEK_END) < 0) + size = lseek(file->fd, 0, SEEK_END); + + if (size < 0) return -1; - size = lseek(file->fd, 0, SEEK_CUR); lseek(file->fd, (off_t)curPos, SEEK_SET); return size;