* lib/_cygwin_S_IEXEC.c: Remove "const" from globals or they never seem to be
defined. Wrap definitions in extern "C". Include winsup.h to assure proper definitions. * dcrt0.cc (dll_crt0_1): Call stdio_init after premain run so that binmode.o, etc., will control default stdio settings. * dtable.cc (dtable::init_std_file_from_handle): Allow __fmode to force binmode/textmode settings. Default pipes to binmode.
This commit is contained in:
		| @@ -1,3 +1,14 @@ | |||||||
|  | Tue Mar 27 22:38:42 2001  Christopher Faylor <cgf@cygnus.com> | ||||||
|  |  | ||||||
|  | 	* lib/_cygwin_S_IEXEC.c: Remove "const" from globals or they never seem | ||||||
|  | 	to be defined.  Wrap definitions in extern "C".  Include winsup.h to | ||||||
|  | 	assure proper definitions. | ||||||
|  |  | ||||||
|  | 	* dcrt0.cc (dll_crt0_1): Call stdio_init after premain run so that | ||||||
|  | 	binmode.o, etc., will control default stdio settings. | ||||||
|  | 	* dtable.cc (dtable::init_std_file_from_handle): Allow __fmode to force | ||||||
|  | 	binmode/textmode settings.  Default pipes to binmode. | ||||||
|  |  | ||||||
| Tue Mar 27 11:31:00 2001  Corinna Vinschen <corinna@vinschen.de> | Tue Mar 27 11:31:00 2001  Corinna Vinschen <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* mmap.cc (mmap): Fix conditional for previous patch. | 	* mmap.cc (mmap): Fix conditional for previous patch. | ||||||
|   | |||||||
| @@ -784,9 +784,6 @@ dll_crt0_1 () | |||||||
|   /* Connect to tty. */ |   /* Connect to tty. */ | ||||||
|   tty_init (); |   tty_init (); | ||||||
|  |  | ||||||
|   /* Set up standard fds in file descriptor table. */ |  | ||||||
|   stdio_init (); |  | ||||||
|  |  | ||||||
|   if (!__argc) |   if (!__argc) | ||||||
|     { |     { | ||||||
|       char *line = GetCommandLineA (); |       char *line = GetCommandLineA (); | ||||||
| @@ -817,6 +814,9 @@ dll_crt0_1 () | |||||||
|     for (unsigned int i = 0; i < PREMAIN_LEN / 2; i++) |     for (unsigned int i = 0; i < PREMAIN_LEN / 2; i++) | ||||||
|       user_data->premain[i] (__argc, __argv, user_data); |       user_data->premain[i] (__argc, __argv, user_data); | ||||||
|  |  | ||||||
|  |   /* Set up standard fds in file descriptor table. */ | ||||||
|  |   stdio_init (); | ||||||
|  |  | ||||||
|   /* Set up __progname for getopt error call. */ |   /* Set up __progname for getopt error call. */ | ||||||
|   __progname = __argv[0]; |   __progname = __argv[0]; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -165,7 +165,13 @@ void | |||||||
| dtable::init_std_file_from_handle (int fd, HANDLE handle, | dtable::init_std_file_from_handle (int fd, HANDLE handle, | ||||||
| 				  DWORD myaccess, const char *name) | 				  DWORD myaccess, const char *name) | ||||||
| { | { | ||||||
|   int bin = binmode ? O_BINARY : 0; |   int bin; | ||||||
|  |  | ||||||
|  |   if (__fmode) | ||||||
|  |     bin = __fmode; | ||||||
|  |   else | ||||||
|  |     bin = binmode ?: 0; | ||||||
|  |  | ||||||
|   /* Check to see if we're being redirected - if not then |   /* Check to see if we're being redirected - if not then | ||||||
|      we open then as consoles */ |      we open then as consoles */ | ||||||
|   if (fd == 0 || fd == 1 || fd == 2) |   if (fd == 0 || fd == 1 || fd == 2) | ||||||
| @@ -190,6 +196,11 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle, | |||||||
| 	  else | 	  else | ||||||
| 	    name = "/dev/conin"; | 	    name = "/dev/conin"; | ||||||
| 	} | 	} | ||||||
|  |       else if (GetFileType (handle) == FILE_TYPE_PIPE) | ||||||
|  | 	{ | ||||||
|  | 	  if (bin == 0) | ||||||
|  | 	    bin = O_BINARY; | ||||||
|  | 	} | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   build_fhandler (fd, name, handle)->init (handle, myaccess, bin); |   build_fhandler (fd, name, handle)->init (handle, myaccess, bin); | ||||||
|   | |||||||
| @@ -8,19 +8,17 @@ This software is a copyrighted work licensed under the terms of the | |||||||
| Cygwin license.  Please consult the file "CYGWIN_LICENSE" for | Cygwin license.  Please consult the file "CYGWIN_LICENSE" for | ||||||
| details. */ | details. */ | ||||||
|  |  | ||||||
| #if 0 | extern "C" { | ||||||
| #include "windows.h" | #include "winsup.h" | ||||||
| #include <sys/cygwin.h> |  | ||||||
| #include "perprocess.h" |  | ||||||
| #endif |  | ||||||
| #include <sys/stat.h> | #include <sys/stat.h> | ||||||
| #include <sys/unistd.h> | #include <sys/unistd.h> | ||||||
|  |  | ||||||
| const unsigned _cygwin_S_IEXEC = S_IEXEC; | unsigned _cygwin_S_IEXEC = S_IEXEC; | ||||||
| const unsigned _cygwin_S_IXUSR = S_IXUSR; | unsigned _cygwin_S_IXUSR = S_IXUSR; | ||||||
| const unsigned _cygwin_S_IXGRP = S_IXGRP; | unsigned _cygwin_S_IXGRP = S_IXGRP; | ||||||
| const unsigned _cygwin_S_IXOTH = S_IXOTH; | unsigned _cygwin_S_IXOTH = S_IXOTH; | ||||||
| const unsigned _cygwin_X_OK = X_OK; | unsigned _cygwin_X_OK = X_OK; | ||||||
|  | }; | ||||||
|  |  | ||||||
| extern int __declspec (dllimport) _check_for_executable; | extern int __declspec (dllimport) _check_for_executable; | ||||||
| struct _cygwin_bob__ | struct _cygwin_bob__ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user