* dtable.cc (dtable::init_std_file_from_handle): Try to mimic standard open
behavior with files redirected from stdin/stdout/stderr, i.e., fmode settings take precedence over mount settings.
This commit is contained in:
parent
d389acbabf
commit
9655ff2680
@ -1,3 +1,9 @@
|
||||
2002-10-07 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* dtable.cc (dtable::init_std_file_from_handle): Try to mimic standard
|
||||
open behavior with files redirected from stdin/stdout/stderr, i.e.,
|
||||
fmode settings take precedence over mount settings.
|
||||
|
||||
2002-10-07 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* dtable.cc (unknown_file): New variable.
|
||||
|
@ -267,8 +267,13 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle, DWORD myaccess)
|
||||
else
|
||||
{
|
||||
path_conv pc;
|
||||
build_fhandler_from_name (fd, name, handle, pc)
|
||||
->init (handle, myaccess, (name == unknown_file) ? 0 : pc.binmode ());
|
||||
unsigned bin;
|
||||
fhandler_base *fh = build_fhandler_from_name (fd, name, handle, pc);
|
||||
bin = fh->get_default_fmode (myaccess == GENERIC_READ ? O_RDONLY : O_WRONLY);
|
||||
if (!bin && name != unknown_file)
|
||||
bin = pc.binmode ();
|
||||
|
||||
fh->init (handle, myaccess, bin);
|
||||
set_std_handle (fd);
|
||||
paranoid_printf ("fd %d, handle %p", fd, handle);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user