From 08b94f415bbce53a9bbc5a11330b7c8fadf92b81 Mon Sep 17 00:00:00 2001 From: unknown 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 BitKeeper/etc/ignore: Added client/mysqlmanager-pwgen to the ignore list client/Makefile.am: mysqlmanager-pwgen client/mysqlmanagerc.c: clean-up include/my_sys.h: added MY_FULL_IO mysql-test/mysql-test-run.sh: started on changes to use mysqlmanager mysys/my_read.c: added support for MY_FULL_IO tools/managertest1.nc: updated test case tools/mysqlmanager.c: added set_exec_stdout and set_exec_stderr --- mysys/my_read.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'mysys/my_read.c') 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