mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 03:27:46 +08:00
2007-03-16 Eric Blake <ebb9@byu.net>
* libc/stdio64/fseek064.c (_fseeko64_r): Fix reentrancy. * libc/stdio64/freopen64.c (_freopen64_r): Ditto.
This commit is contained in:
parent
826b5591dd
commit
a167bcd8e5
@ -1,3 +1,8 @@
|
|||||||
|
2007-03-16 Eric Blake <ebb9@byu.net>
|
||||||
|
|
||||||
|
* libc/stdio64/fseek064.c (_fseeko64_r): Fix reentrancy.
|
||||||
|
* libc/stdio64/freopen64.c (_freopen64_r): Ditto.
|
||||||
|
|
||||||
2007-03-15 Jeff Johnston <jjohnstn@redhat.com>
|
2007-03-15 Jeff Johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
* configure.in: Add new --enable-newlib-reent-small option.
|
* configure.in: Add new --enable-newlib-reent-small option.
|
||||||
|
@ -196,10 +196,10 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp),
|
|||||||
fp->_bf._size = 0;
|
fp->_bf._size = 0;
|
||||||
fp->_lbfsize = 0;
|
fp->_lbfsize = 0;
|
||||||
if (HASUB (fp))
|
if (HASUB (fp))
|
||||||
FREEUB (fp);
|
FREEUB (ptr, fp);
|
||||||
fp->_ub._size = 0;
|
fp->_ub._size = 0;
|
||||||
if (HASLB (fp))
|
if (HASLB (fp))
|
||||||
FREELB (fp);
|
FREELB (ptr, fp);
|
||||||
fp->_lb._size = 0;
|
fp->_lb._size = 0;
|
||||||
|
|
||||||
if (f < 0)
|
if (f < 0)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1990 The Regents of the University of California.
|
* Copyright (c) 1990, 2007 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms are permitted
|
* Redistribution and use in source and binary forms are permitted
|
||||||
@ -197,7 +197,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence),
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (fp->_bf._base == NULL)
|
if (fp->_bf._base == NULL)
|
||||||
__smakebuf (fp);
|
__smakebuf_r (ptr, fp);
|
||||||
if (fp->_flags & (__SWR | __SRW | __SNBF | __SNPT))
|
if (fp->_flags & (__SWR | __SRW | __SNBF | __SNPT))
|
||||||
goto dumb;
|
goto dumb;
|
||||||
if ((fp->_flags & __SOPT) == 0)
|
if ((fp->_flags & __SOPT) == 0)
|
||||||
@ -283,7 +283,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence),
|
|||||||
fp->_p = fp->_bf._base + o;
|
fp->_p = fp->_bf._base + o;
|
||||||
fp->_r = n - o;
|
fp->_r = n - o;
|
||||||
if (HASUB (fp))
|
if (HASUB (fp))
|
||||||
FREEUB (fp);
|
FREEUB (ptr, fp);
|
||||||
fp->_flags &= ~__SEOF;
|
fp->_flags &= ~__SEOF;
|
||||||
_funlockfile(fp);
|
_funlockfile(fp);
|
||||||
return 0;
|
return 0;
|
||||||
@ -304,7 +304,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence),
|
|||||||
fp->_r = 0;
|
fp->_r = 0;
|
||||||
fp->_p = fp->_bf._base;
|
fp->_p = fp->_bf._base;
|
||||||
if (HASUB (fp))
|
if (HASUB (fp))
|
||||||
FREEUB (fp);
|
FREEUB (ptr, fp);
|
||||||
fp->_flags &= ~__SEOF;
|
fp->_flags &= ~__SEOF;
|
||||||
n = target - curoff;
|
n = target - curoff;
|
||||||
if (n)
|
if (n)
|
||||||
@ -330,7 +330,7 @@ dumb:
|
|||||||
}
|
}
|
||||||
/* success: clear EOF indicator and discard ungetc() data */
|
/* success: clear EOF indicator and discard ungetc() data */
|
||||||
if (HASUB (fp))
|
if (HASUB (fp))
|
||||||
FREEUB (fp);
|
FREEUB (ptr, fp);
|
||||||
fp->_p = fp->_bf._base;
|
fp->_p = fp->_bf._base;
|
||||||
fp->_r = 0;
|
fp->_r = 0;
|
||||||
/* fp->_w = 0; *//* unnecessary (I think...) */
|
/* fp->_w = 0; *//* unnecessary (I think...) */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user