projects
/
platform
/
upstream
/
VK-GL-CTS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f87ba8
)
Fix deFile_getSize.
author
Mika Isojärvi
<misojarvi@google.com>
Mon, 2 Nov 2015 22:26:28 +0000
(14:26 -0800)
committer
Mika Isojärvi
<misojarvi@google.com>
Mon, 2 Nov 2015 23:36:16 +0000
(15:36 -0800)
Seek to the end of the file instead of second last byte of the file.
Change-Id: I2cdb6db50d4b0d3b73ea83edfedaf1645b766808
framework/delibs/deutil/deFile.c
patch
|
blob
|
history
diff --git
a/framework/delibs/deutil/deFile.c
b/framework/delibs/deutil/deFile.c
index
3cd1265
..
1587a1d
100644
(file)
--- 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;