summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <rburnett@production.mysql.com>2006-03-15 10:25:42 +0100
committerunknown <rburnett@production.mysql.com>2006-03-15 10:25:42 +0100
commit5cb93cc3149cfbba2f7e1a6baff943fc551d71ab (patch)
tree019b3e74797aec241daf597d1fa195c09c35afae
parent4ac5afa3b991654a38b39ad44880e74da06a02c3 (diff)
downloadmariadb-git-5cb93cc3149cfbba2f7e1a6baff943fc551d71ab.tar.gz
Bug #17722 Test 'partition_02myisam' hangs on Windows
The problem where is that Visual Studio 8 includes new security features to help write more secure code. One of these features is parameter validation. Many of the CRT functions, including lseek, assert on illegal parameter values in debug builds. They also call parameter validation callback routines that can be registered. We solve this problem by defaulting the error value to -1 and then only calling lseek if the fd != -1. my_seek.c: Only call lseek if the fd is not -1 on Windows mysys/my_seek.c: Only call lseek if the fd is not -1 on Windows
-rw-r--r--mysys/my_seek.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mysys/my_seek.c b/mysys/my_seek.c
index 6af65d70fd0..e5b1905e551 100644
--- a/mysys/my_seek.c
+++ b/mysys/my_seek.c
@@ -22,14 +22,15 @@
my_off_t my_seek(File fd, my_off_t pos, int whence,
myf MyFlags __attribute__((unused)))
{
- reg1 os_off_t newpos;
+ reg1 os_off_t newpos= -1;
DBUG_ENTER("my_seek");
DBUG_PRINT("my",("Fd: %d Hpos: %lu Pos: %lu Whence: %d MyFlags: %d",
fd, (ulong) (((ulonglong) pos) >> 32), (ulong) pos,
whence, MyFlags));
DBUG_ASSERT(pos != MY_FILEPOS_ERROR); /* safety check */
- newpos=lseek(fd, pos, whence);
+ if (-1 != fd)
+ newpos=lseek(fd, pos, whence);
if (newpos == (os_off_t) -1)
{
my_errno=errno;