From 1a0a77389f3448dc2557a1a1fecafbeb86cc7b32 Mon Sep 17 00:00:00 2001 From: "sasha@mysql.sashanet.com" <> Date: Sat, 22 Sep 2001 21:47:57 -0600 Subject: added mysqlmanager-pwgen added set_exec_stdout and set_exec_stderr to mysqlmanager to be able to redirect stdout and stderr added support for MY_FULL_IO to my_read, so we can tell it to read a number of bytes in as many chunks as it takes instead of one try --- mysys/my_read.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'mysys') diff --git a/mysys/my_read.c b/mysys/my_read.c index b317630f4bd..9a6c7f4d9dc 100644 --- a/mysys/my_read.c +++ b/mysys/my_read.c @@ -28,10 +28,11 @@ uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags) /* Max number of bytes returnd */ /* Flags on what to do on error */ { - uint readbytes; + uint readbytes,save_count; DBUG_ENTER("my_read"); DBUG_PRINT("my",("Fd: %d Buffer: %lx Count: %u MyFlags: %d", Filedes, Buffer, Count, MyFlags)); + save_count=Count; for (;;) { @@ -54,12 +55,21 @@ uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags) my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG), my_filename(Filedes),my_errno); } - if ((int) readbytes == -1 || (MyFlags & (MY_FNABP | MY_NABP))) + if ((int) readbytes == -1 || + ((MyFlags & (MY_FNABP | MY_NABP)) && !(MyFlags & MY_FULL_IO))) DBUG_RETURN(MY_FILE_ERROR); /* Return with error */ + if (readbytes > 0 && (MyFlags & MY_FULL_IO)) + { + Buffer+=readbytes; + Count-=readbytes; + continue; + } } if (MyFlags & (MY_NABP | MY_FNABP)) readbytes=0; /* Ok on read */ + else if (MyFlags & MY_FULL_IO) + readbytes=save_count; break; } DBUG_RETURN(readbytes); -- cgit v1.2.1