Subversion Repositories Kolibri OS

Rev

Rev 1693 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1693 Rev 3065
Line 18... Line 18...
18
 */
18
 */
Line 19... Line 19...
19
 
19
 
20
#include <_ansi.h>
20
#include <_ansi.h>
21
#include 
21
#include 
-
 
22
#include 
22
#include 
23
#include 
Line 23... Line 24...
23
#include "local.h"
24
#include "local.h"
24
 
25
 
25
/*
26
/*
26
 * Various output routines call wsetup to be sure it is safe to write,
27
 * Various output routines call wsetup to be sure it is safe to write,
27
 * because either _flags does not include __SWR, or _buf is NULL.
28
 * because either _flags does not include __SWR, or _buf is NULL.
Line 28... Line 29...
28
 * _wsetup returns 0 if OK to write, nonzero otherwise.
29
 * _wsetup returns 0 if OK to write, nonzero and set errno otherwise.
29
 */
30
 */
30
 
31
 
Line 42... Line 43...
42
   */
43
   */
Line 43... Line 44...
43
 
44
 
44
  if ((fp->_flags & __SWR) == 0)
45
  if ((fp->_flags & __SWR) == 0)
45
    {
46
    {
-
 
47
      if ((fp->_flags & __SRW) == 0)
-
 
48
        {
-
 
49
	  ptr->_errno = EBADF;
46
      if ((fp->_flags & __SRW) == 0)
50
	  fp->_flags |= __SERR;
-
 
51
	return EOF;
47
	return EOF;
52
        }
48
      if (fp->_flags & __SRD)
53
      if (fp->_flags & __SRD)
49
	{
54
	{
50
	  /* clobber any ungetc data */
55
	  /* clobber any ungetc data */
51
	  if (HASUB (fp))
56
	  if (HASUB (fp))
Line 77... Line 82...
77
      fp->_lbfsize = -fp->_bf._size;
82
      fp->_lbfsize = -fp->_bf._size;
78
    }
83
    }
79
  else
84
  else
80
    fp->_w = fp->_flags & __SNBF ? 0 : fp->_bf._size;
85
    fp->_w = fp->_flags & __SNBF ? 0 : fp->_bf._size;
Line 81... Line 86...
81
 
86
 
-
 
87
  if (!fp->_bf._base && (fp->_flags & __SMBF))
-
 
88
    {
-
 
89
      /* __smakebuf_r set errno, but not flag */
-
 
90
      fp->_flags |= __SERR;
-
 
91
      return EOF;
-
 
92
    }
82
  return (!fp->_bf._base && (fp->_flags & __SMBF)) ? EOF : 0;
93
  return 0;