diff options
author | unknown <msvensson@neptunus.(none)> | 2007-02-16 15:19:38 +0100 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2007-02-16 15:19:38 +0100 |
commit | a843a05f92b962477ee338f26696e253ed23607f (patch) | |
tree | fc724091b55b15d153b7c8e6b6c198501b0f89e9 /client/echo.c | |
parent | 7560dbd23307c2d697cdad92489738eab30e5dc5 (diff) | |
download | mariadb-git-a843a05f92b962477ee338f26696e253ed23607f.tar.gz |
Workaround for problem where cygwin's bash/sh randomly fails with error 128 which
mainly occurs on win2003 64bit.
- Execute "exec" commands directly with cmd.exe and replace "--exec echo ..." with "--exec .\echo.exe ..."
client/mysqltest.c:
Workaround the problem with "echo" in windows not behaving like "echo" in Unix.
- Replace "--exec echo ..." with "--exec <path to mysqltest>\echo.exe" thus forcing
use of our own echo implementation which baheves like on Unix.
- The above change makes it possible to remove the need to execute all --exec's
inside cygwin. Add ifdefs to only use use cygwin's bash conditionally
mysql-test/lib/mtr_misc.pl:
Add function for converting to the OS's native format
mysql-test/mysql-test-run.pl:
Convert path to executables to "windows native" (c:\<path>\) instead of "mixed"(c:/<path>) mode
necessary for pipes and redirects to work properly in cmd.exe
client/echo.c:
New BitKeeper file ``client/echo.c''
Diffstat (limited to 'client/echo.c')
-rw-r--r-- | client/echo.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/client/echo.c b/client/echo.c new file mode 100644 index 00000000000..4483eaad293 --- /dev/null +++ b/client/echo.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2000 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + echo is a replacement for the "echo" command builtin to cmd.exe + on Windows, to get a Unix eqvivalent behaviour when running commands + like: + $> echo "hello" | mysql + + The windows "echo" would have sent "hello" to mysql while + Unix echo will send hello without the enclosing hyphens + + This is a very advanced high tech program so take care when + you change it and remember to valgrind it before production + use. + +*/ + +#include <stdio.h> + +int main(int argc, char **argv) +{ + int i; + for (i= 1; i < argc; i++) + { + fprintf(stdout, "%s", argv[i]); + if (i < argc - 1) + fprintf(stdout, " "); + } + fprintf(stdout, "\n"); + return 0; +} |