summaryrefslogtreecommitdiff
path: root/mysys/my_seek.c
diff options
context:
space:
mode:
authorunknown <georg@lmy002.wdf.sap.corp>2006-09-01 14:34:37 +0200
committerunknown <georg@lmy002.wdf.sap.corp>2006-09-01 14:34:37 +0200
commit5d3e6c275857fabffe9e38d979a12017cc257494 (patch)
treeb624943770ca093aa4373ff91f83fddb3b932094 /mysys/my_seek.c
parentcce4cc25a9a3927d4d947d4ce006343f4503729e (diff)
downloadmariadb-git-5d3e6c275857fabffe9e38d979a12017cc257494.tar.gz
Fixes for crashes and test failures
scripts/make_win_bin_dist: BitKeeper file /home/georg/work/mysql/prod/mysql-5.0-win/scripts/make_win_bin_dist client/mysqlbinlog.cc: Fix for cmake build: Cmake doesn't use the VC++ files extra/comp_err.c: fixed windows crash (debug): We can't call DBUG_RETURN after my_end. include/my_dbug.h: added missing empty define for DBUG_LEAVE to prevent precompiler errors when compiling in non_debug mode mysql-test/mysql-test-run.pl: Added support for new cmake release and debug paths. mysql-test/t/system_mysql_db_fix.test: This test requires unix shell script mysql_fix_previleges_tables -> skip under windows mysys/my_seek.c: Fix for windows debug crash. However this solution is bad: we should never call lseek with an invalid file pointer. sql/ha_archive.cc: Fixed windows crash: We need dup in gzdopen to keep the filehandle open, otherwise subsequent calls to mysql_close will fail/crash.
Diffstat (limited to 'mysys/my_seek.c')
-rw-r--r--mysys/my_seek.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mysys/my_seek.c b/mysys/my_seek.c
index 6af65d70fd0..8035312496d 100644
--- a/mysys/my_seek.c
+++ b/mysys/my_seek.c
@@ -29,7 +29,8 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
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;