diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-09-22 21:47:57 -0600 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-09-22 21:47:57 -0600 |
commit | 08b94f415bbce53a9bbc5a11330b7c8fadf92b81 (patch) | |
tree | 5842a4d7b8d3728781c758ff3c724c456c3be963 /mysys/my_read.c | |
parent | 8057a797a0cbef5bf59d37d0a8722a294b6e9f6a (diff) | |
download | mariadb-git-08b94f415bbce53a9bbc5a11330b7c8fadf92b81.tar.gz |
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
Diffstat (limited to 'mysys/my_read.c')
-rw-r--r-- | mysys/my_read.c | 14 |
1 files changed, 12 insertions, 2 deletions
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); |