* fhandler.h (fhandler_base::clear_r_binary): New method.
(fhandler_base::clear_w_binary): New method. * syscalls.cc (setmode): Accept 0 as mode value. Resets text/binary behavior for fd to default.
This commit is contained in:
parent
ca608f5682
commit
9cf9c14668
|
@ -1,3 +1,10 @@
|
|||
Mon Apr 23 13:28:35 2001 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* fhandler.h (fhandler_base::clear_r_binary): New method.
|
||||
(fhandler_base::clear_w_binary): New method.
|
||||
* syscalls.cc (setmode): Accept 0 as mode value. Resets text/binary
|
||||
behavior for fd to default.
|
||||
|
||||
Mon Apr 23 12:46:07 2001 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* net.cc [errmap]: Add '0' condition.
|
||||
|
|
|
@ -197,6 +197,8 @@ public:
|
|||
|
||||
void set_w_binary (int b) { FHCONDSETF (b, WBINARY); FHSETF (WBINSET); }
|
||||
void set_r_binary (int b) { FHCONDSETF (b, RBINARY); FHSETF (RBINSET); }
|
||||
void clear_w_binary () {FHCLEARF (WBINARY); FHCLEARF (WBINSET); }
|
||||
void clear_r_binary () {FHCLEARF (RBINARY); FHCLEARF (RBINSET); }
|
||||
|
||||
int get_default_fmode (int flags);
|
||||
|
||||
|
|
|
@ -1646,19 +1646,26 @@ setmode (int fd, int mode)
|
|||
int res;
|
||||
if (p->get_w_binary () && p->get_r_binary ())
|
||||
res = O_BINARY;
|
||||
else if (p->get_w_binset () && p->get_r_binset ())
|
||||
res = O_TEXT; /* Specifically set O_TEXT */
|
||||
else
|
||||
res = O_TEXT;
|
||||
res = 0;
|
||||
|
||||
if (mode & O_BINARY)
|
||||
{
|
||||
p->set_w_binary (1);
|
||||
p->set_r_binary (1);
|
||||
}
|
||||
else
|
||||
else if (mode & O_TEXT)
|
||||
{
|
||||
p->set_w_binary (0);
|
||||
p->set_r_binary (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
p->clear_w_binary ();
|
||||
p->clear_r_binary ();
|
||||
}
|
||||
|
||||
if (_cygwin_istext_for_stdio (fd))
|
||||
setmode_mode = O_TEXT;
|
||||
|
|
Loading…
Reference in New Issue