diff options
author | thek@kpdesk.mysql.com <> | 2006-10-31 09:26:16 +0100 |
---|---|---|
committer | thek@kpdesk.mysql.com <> | 2006-10-31 09:26:16 +0100 |
commit | 12d8f2bf3122f23898e64d2eb37dd8dfc9a5f7b4 (patch) | |
tree | b2d88349ef7e2524023ae7c58023a5574a064456 /mysys/my_chsize.c | |
parent | 397f0df9ad2df62698d4c1824c965c4b884b990c (diff) | |
download | mariadb-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.c | 6 |
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 |