Dep/MySQL: Updated MySQL sources to version 5.5.9 (current GA)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#include "mysys_priv.h"
|
||||
#include "mysys_err.h"
|
||||
|
||||
/*
|
||||
Seek to a position in a file.
|
||||
@@ -42,39 +43,34 @@
|
||||
actual error.
|
||||
*/
|
||||
|
||||
my_off_t my_seek(File fd, my_off_t pos, int whence,
|
||||
myf MyFlags __attribute__((unused)))
|
||||
my_off_t my_seek(File fd, my_off_t pos, int whence, myf MyFlags)
|
||||
{
|
||||
reg1 os_off_t newpos= -1;
|
||||
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_PRINT("my",("fd: %d Pos: %llu Whence: %d MyFlags: %d",
|
||||
fd, (ulonglong) pos, whence, MyFlags));
|
||||
DBUG_ASSERT(pos != MY_FILEPOS_ERROR); /* safety check */
|
||||
|
||||
/*
|
||||
Make sure we are using a valid file descriptor!
|
||||
*/
|
||||
DBUG_ASSERT(fd != -1);
|
||||
#if defined(THREAD) && !defined(HAVE_PREAD)
|
||||
if (MyFlags & MY_THREADSAFE)
|
||||
{
|
||||
pthread_mutex_lock(&my_file_info[fd].mutex);
|
||||
newpos= lseek(fd, pos, whence);
|
||||
pthread_mutex_unlock(&my_file_info[fd].mutex);
|
||||
}
|
||||
else
|
||||
#if defined (_WIN32)
|
||||
newpos= my_win_lseek(fd, pos, whence);
|
||||
#else
|
||||
newpos= lseek(fd, pos, whence);
|
||||
#endif
|
||||
newpos= lseek(fd, pos, whence);
|
||||
if (newpos == (os_off_t) -1)
|
||||
{
|
||||
my_errno=errno;
|
||||
DBUG_PRINT("error",("lseek: %lu errno: %d", (ulong) newpos,errno));
|
||||
my_errno= errno;
|
||||
if (MyFlags & MY_WME)
|
||||
my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno);
|
||||
DBUG_PRINT("error", ("lseek: %llu errno: %d", (ulonglong) newpos, errno));
|
||||
DBUG_RETURN(MY_FILEPOS_ERROR);
|
||||
}
|
||||
if ((my_off_t) newpos != pos)
|
||||
{
|
||||
DBUG_PRINT("exit",("pos: %lu", (ulong) newpos));
|
||||
DBUG_PRINT("exit",("pos: %llu", (ulonglong) newpos));
|
||||
}
|
||||
DBUG_RETURN((my_off_t) newpos);
|
||||
} /* my_seek */
|
||||
@@ -83,19 +79,24 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
|
||||
/* Tell current position of file */
|
||||
/* ARGSUSED */
|
||||
|
||||
my_off_t my_tell(File fd, myf MyFlags __attribute__((unused)))
|
||||
my_off_t my_tell(File fd, myf MyFlags)
|
||||
{
|
||||
os_off_t pos;
|
||||
DBUG_ENTER("my_tell");
|
||||
DBUG_PRINT("my",("Fd: %d MyFlags: %d",fd, MyFlags));
|
||||
DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags));
|
||||
DBUG_ASSERT(fd >= 0);
|
||||
#ifdef HAVE_TELL
|
||||
pos=tell(fd);
|
||||
#if defined (HAVE_TELL) && !defined (_WIN32)
|
||||
pos= tell(fd);
|
||||
#else
|
||||
pos=lseek(fd, 0L, MY_SEEK_CUR);
|
||||
pos= my_seek(fd, 0L, MY_SEEK_CUR,0);
|
||||
#endif
|
||||
if (pos == (os_off_t) -1)
|
||||
my_errno=errno;
|
||||
DBUG_PRINT("exit",("pos: %lu", (ulong) pos));
|
||||
{
|
||||
my_errno= errno;
|
||||
if (MyFlags & MY_WME)
|
||||
my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno);
|
||||
DBUG_PRINT("error", ("tell: %llu errno: %d", (ulonglong) pos, my_errno));
|
||||
}
|
||||
DBUG_PRINT("exit",("pos: %llu", (ulonglong) pos));
|
||||
DBUG_RETURN((my_off_t) pos);
|
||||
} /* my_tell */
|
||||
|
||||
Reference in New Issue
Block a user