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 72... Line 72...
72
  int r;
72
  int r;
Line 73... Line 73...
73
 
73
 
74
  if (fp == NULL)
74
  if (fp == NULL)
Line 75... Line -...
75
    return (0);			/* on NULL */
-
 
76
 
-
 
77
  __sfp_lock_acquire ();
75
    return (0);			/* on NULL */
Line 78... Line 76...
78
 
76
 
Line 79... Line 77...
79
  CHECK_INIT (rptr, fp);
77
  CHECK_INIT (rptr, fp);
80
 
78
 
81
  _flockfile (fp);
79
  _flockfile (fp);
82
 
-
 
83
  if (fp->_flags == 0)		/* not open! */
80
 
84
    {
81
  if (fp->_flags == 0)		/* not open! */
85
      _funlockfile (fp);
82
    {
86
      __sfp_lock_release ();
83
      _funlockfile (fp);
87
      return (0);
84
      return (0);
Line 96... Line 93...
96
    _free_r (rptr, (char *) fp->_bf._base);
93
    _free_r (rptr, (char *) fp->_bf._base);
97
  if (HASUB (fp))
94
  if (HASUB (fp))
98
    FREEUB (rptr, fp);
95
    FREEUB (rptr, fp);
99
  if (HASLB (fp))
96
  if (HASLB (fp))
100
    FREELB (rptr, fp);
97
    FREELB (rptr, fp);
-
 
98
  __sfp_lock_acquire ();
101
  fp->_flags = 0;		/* release this FILE for reuse */
99
  fp->_flags = 0;		/* release this FILE for reuse */
102
  _funlockfile (fp);
100
  _funlockfile (fp);
103
#ifndef __SINGLE_THREAD__
101
#ifndef __SINGLE_THREAD__
104
  __lock_close_recursive (fp->_lock);
102
  __lock_close_recursive (fp->_lock);
105
#endif
103
#endif