aboutsummaryrefslogtreecommitdiff
path: root/tools/plink/winplink.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-11-19 12:21:42 +0000
committermarha <marha@users.sourceforge.net>2010-11-19 12:21:42 +0000
commit79b0bee7c7af3c5035cddde18497e54d38cf8dbc (patch)
treeb2fbea50cfb846049fc690a252baec07397a1acc /tools/plink/winplink.c
parent6be86147f292b3178413bc644853ad80b620042e (diff)
downloadvcxsrv-79b0bee7c7af3c5035cddde18497e54d38cf8dbc.tar.gz
vcxsrv-79b0bee7c7af3c5035cddde18497e54d38cf8dbc.tar.bz2
vcxsrv-79b0bee7c7af3c5035cddde18497e54d38cf8dbc.zip
Switched to original version of plink in release branch.
Diffstat (limited to 'tools/plink/winplink.c')
-rw-r--r--tools/plink/winplink.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/tools/plink/winplink.c b/tools/plink/winplink.c
index 0d7c501fe..525b1a212 100644
--- a/tools/plink/winplink.c
+++ b/tools/plink/winplink.c
@@ -3,7 +3,6 @@
*/
#include <stdio.h>
-#include <fcntl.h>
#include <stdlib.h>
#include <assert.h>
#include <stdarg.h>
@@ -718,55 +717,3 @@ int main(int argc, char **argv)
cleanup_exit(exitcode);
return 0; /* placate compiler warning */
}
-
-#ifdef _MSC_VER
-#pragma warning(disable:4273)
-#endif
-
-_Check_return_opt_ int __cdecl printf(_In_z_ _Printf_format_string_ const char * pFmt, ...)
-{
- static int ConsoleCreated=0;
- va_list arglist;
- if (!ConsoleCreated)
- {
- int hConHandle;
- long lStdHandle;
- CONSOLE_SCREEN_BUFFER_INFO coninfo;
-
- FILE *fp;
- const unsigned int MAX_CONSOLE_LINES = 500;
- ConsoleCreated=1;
- if (!AttachConsole(ATTACH_PARENT_PROCESS))
- AllocConsole();
-
- // set the screen buffer to be big enough to let us scroll text
- GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
- coninfo.dwSize.Y = MAX_CONSOLE_LINES;
- SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
-
- // redirect unbuffered STDOUT to the console
- lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
- hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
- fp = _fdopen( hConHandle, "w" );
- *stdout = *fp;
- setvbuf( stdout, NULL, _IONBF, 0 );
-
- // redirect unbuffered STDIN to the console
- lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE);
- hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
- fp = _fdopen( hConHandle, "r" );
- *stdin = *fp;
- setvbuf( stdin, NULL, _IONBF, 0 );
-
- // redirect unbuffered STDERR to the console
- lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE);
- hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
- fp = _fdopen( hConHandle, "w" );
- *stderr = *fp;
- setvbuf( stderr, NULL, _IONBF, 0 );
-
- }
-
- va_start(arglist, pFmt );
- return vfprintf(stderr, pFmt, arglist);
-}