fp->_flags2 &= ~(_IO_FLAGS2_MMAP
| _IO_FLAGS2_NOTCANCEL
| _IO_FLAGS2_CLOEXEC);
+ fp->_mode = 0;
result = _IO_old_file_fopen (fp, gfilename, mode);
}
else
fp->_flags2 &= ~(_IO_FLAGS2_MMAP
| _IO_FLAGS2_NOTCANCEL
| _IO_FLAGS2_CLOEXEC);
+ fp->_mode = 0;
result = _IO_file_fopen (fp, gfilename, mode, 1);
if (result != NULL)
result = __fopen_maybe_mmap (result);
fp->_flags2 &= ~_IO_FLAGS2_NOCLOSE;
if (result != NULL)
{
- /* unbound stream orientation */
- result->_mode = 0;
-
if (fd != -1 && _IO_fileno (result) != fd)
{
/* At this point we have both file descriptors already allocated,
fp->_flags2 &= ~(_IO_FLAGS2_MMAP
| _IO_FLAGS2_NOTCANCEL
| _IO_FLAGS2_CLOEXEC);
+ fp->_mode = 0;
result = _IO_file_fopen (fp, gfilename, mode, 0);
fp->_flags2 &= ~_IO_FLAGS2_NOCLOSE;
if (result != NULL)
result = __fopen_maybe_mmap (result);
if (result != NULL)
{
- /* unbound stream orientation */
- result->_mode = 0;
-
if (fd != -1 && _IO_fileno (result) != fd)
{
/* At this point we have both file descriptors already allocated,
fp = xfopen (file2, "w,ccs=iso-8859-1");
ret = fputws (L"\xc0\xc1", fp);
TEST_VERIFY (ret >= 0);
-#if 0 /* Doesn't work (bug 23675). */
fp = FREOPEN (file1, "r,ccs=utf-8", fp);
TEST_VERIFY_EXIT (fp != NULL);
-#else /* Works instead. */
- xfclose (fp);
- fp = xfopen (file1, "r,ccs=utf-8");
-#endif
wc = fgetwc (fp);
TEST_COMPARE (wc, (wint_t) 0xc0);
wc = fgetwc (fp);