summaryrefslogtreecommitdiff
path: root/mysys/my_chsize.c
diff options
context:
space:
mode:
authorthek@kpdesk.mysql.com <>2006-10-31 09:26:16 +0100
committerthek@kpdesk.mysql.com <>2006-10-31 09:26:16 +0100
commit12d8f2bf3122f23898e64d2eb37dd8dfc9a5f7b4 (patch)
treeb2d88349ef7e2524023ae7c58023a5574a064456 /mysys/my_chsize.c
parent397f0df9ad2df62698d4c1824c965c4b884b990c (diff)
downloadmariadb-git-12d8f2bf3122f23898e64d2eb37dd8dfc9a5f7b4.tar.gz
Bug#22828 _my_b_read() ignores return values for my_seek() calls
- Because my_seek actually is capable of returning an error code we should exploit that in the best possible way. - There might be kernel errors or other errors we can't predict and capturing the return value of all system calls gives us better understanding of possible errors.
Diffstat (limited to 'mysys/my_chsize.c')
-rw-r--r--mysys/my_chsize.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c
index cf26428d65f..b925b52ac03 100644
--- a/mysys/my_chsize.c
+++ b/mysys/my_chsize.c
@@ -88,7 +88,11 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
Fill space between requested length and true length with 'filler'
We should never come here on any modern machine
*/
- VOID(my_seek(fd, newlength, MY_SEEK_SET, MYF(MY_WME+MY_FAE)));
+ if (my_seek(fd, newlength, MY_SEEK_SET, MYF(MY_WME+MY_FAE))
+ == MY_FILEPOS_ERROR)
+ {
+ goto err;
+ }
swap_variables(my_off_t, newlength, oldsize);
}
#endif