mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 12:05:47 +08:00
* fhandler_console.cc (fhandler_console::open): Reinstate setting of flags.
This commit is contained in:
parent
de86e35bc4
commit
8e74c3207f
@ -1,3 +1,8 @@
|
|||||||
|
2002-05-31 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* fhandler_console.cc (fhandler_console::open): Reinstate setting of
|
||||||
|
flags.
|
||||||
|
|
||||||
2002-05-31 Christopher Faylor <cgf@redhat.com>
|
2002-05-31 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* fhandler_console.cc (fhandler_console::open): Always default to
|
* fhandler_console.cc (fhandler_console::open): Always default to
|
||||||
|
@ -217,7 +217,7 @@ cygwin_attach_handle_to_fd (char *name, int fd, HANDLE handle, mode_t bin,
|
|||||||
void
|
void
|
||||||
dtable::init_std_file_from_handle (int fd, HANDLE handle, DWORD myaccess)
|
dtable::init_std_file_from_handle (int fd, HANDLE handle, DWORD myaccess)
|
||||||
{
|
{
|
||||||
int bin = 0;
|
int bin = -1;
|
||||||
const char *name;
|
const char *name;
|
||||||
CONSOLE_SCREEN_BUFFER_INFO buf;
|
CONSOLE_SCREEN_BUFFER_INFO buf;
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
@ -238,7 +238,7 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle, DWORD myaccess)
|
|||||||
if (__fmode)
|
if (__fmode)
|
||||||
bin = __fmode;
|
bin = __fmode;
|
||||||
else
|
else
|
||||||
bin = binmode ?: 0;
|
bin = (int) binmode ?: -1;
|
||||||
|
|
||||||
/* See if we can consoleify it - if it is a console,
|
/* See if we can consoleify it - if it is a console,
|
||||||
don't open it in binary. That will screw up our crlfs*/
|
don't open it in binary. That will screw up our crlfs*/
|
||||||
@ -280,7 +280,8 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle, DWORD myaccess)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
path_conv pc;
|
path_conv pc;
|
||||||
build_fhandler_from_name (fd, name, handle, pc)->init (handle, myaccess, bin);
|
build_fhandler_from_name (fd, name, handle, pc)->init (handle, myaccess,
|
||||||
|
bin < 0 ? pc.isbinary () : bin);
|
||||||
set_std_handle (fd);
|
set_std_handle (fd);
|
||||||
paranoid_printf ("fd %d, handle %p", fd, handle);
|
paranoid_printf ("fd %d, handle %p", fd, handle);
|
||||||
}
|
}
|
||||||
|
@ -1169,3 +1169,5 @@ fhandler_base::closedir (DIR *)
|
|||||||
set_errno (ENOTDIR);
|
set_errno (ENOTDIR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
bool fhandler_base::get_w_binary () { return FHISSETF (WBINSET) ? FHISSETF (WBINARY) : 1; }
|
||||||
|
bool fhandler_base::get_r_binary () { return FHISSETF (RBINSET) ? FHISSETF (RBINARY) : 1; }
|
||||||
|
@ -179,8 +179,8 @@ class fhandler_base
|
|||||||
bool is_nonblocking ();
|
bool is_nonblocking ();
|
||||||
void set_nonblocking (int yes);
|
void set_nonblocking (int yes);
|
||||||
|
|
||||||
bool get_w_binary () { return FHISSETF (WBINARY); }
|
bool get_w_binary () { return FHISSETF (WBINSET) ? FHISSETF (WBINARY) : 1; }
|
||||||
bool get_r_binary () { return FHISSETF (RBINARY); }
|
bool get_r_binary () { return FHISSETF (RBINSET) ? FHISSETF (RBINARY) : 1; }
|
||||||
|
|
||||||
bool get_w_binset () { return FHISSETF (WBINSET); }
|
bool get_w_binset () { return FHISSETF (WBINSET); }
|
||||||
bool get_r_binset () { return FHISSETF (RBINSET); }
|
bool get_r_binset () { return FHISSETF (RBINSET); }
|
||||||
|
@ -547,6 +547,7 @@ fhandler_console::open (path_conv *, int flags, mode_t)
|
|||||||
set_io_handle (INVALID_HANDLE_VALUE);
|
set_io_handle (INVALID_HANDLE_VALUE);
|
||||||
set_output_handle (INVALID_HANDLE_VALUE);
|
set_output_handle (INVALID_HANDLE_VALUE);
|
||||||
|
|
||||||
|
set_flags (flags);
|
||||||
set_w_binary (1);
|
set_w_binary (1);
|
||||||
set_r_binary (1);
|
set_r_binary (1);
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ num_entries (const char *win32_name)
|
|||||||
int __stdcall
|
int __stdcall
|
||||||
fhandler_disk_file::fstat_by_handle (struct __stat64 *buf, path_conv *pc)
|
fhandler_disk_file::fstat_by_handle (struct __stat64 *buf, path_conv *pc)
|
||||||
{
|
{
|
||||||
int res;
|
int res = 0;
|
||||||
BY_HANDLE_FILE_INFORMATION local;
|
BY_HANDLE_FILE_INFORMATION local;
|
||||||
|
|
||||||
/* NT 3.51 seems to have a bug when attempting to get vol serial
|
/* NT 3.51 seems to have a bug when attempting to get vol serial
|
||||||
|
@ -741,7 +741,6 @@ out:
|
|||||||
if (tail[1] != '\0')
|
if (tail[1] != '\0')
|
||||||
*tail = '/';
|
*tail = '/';
|
||||||
normalized_path = cstrdup (path_copy);
|
normalized_path = cstrdup (path_copy);
|
||||||
debug_printf ("path_copy %s", path_copy);
|
|
||||||
}
|
}
|
||||||
/* Deal with Windows stupidity which considers filename\. to be valid
|
/* Deal with Windows stupidity which considers filename\. to be valid
|
||||||
even when "filename" is not a directory. */
|
even when "filename" is not a directory. */
|
||||||
@ -814,6 +813,7 @@ out:
|
|||||||
path_flags |= PATH_EXEC;
|
path_flags |= PATH_EXEC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug_printf ("binary %d", isbinary ());
|
||||||
#if 0
|
#if 0
|
||||||
if (!error)
|
if (!error)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user