mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Update.
* libio/iofopncook.c (_IO_cookie_seekoff): Define. Mark offset as invalid to disable optimizations in fileops which won't work here. (_IO_cookie_jumps): Use it. (_IO_old_cookie_jumps): Likewise. * libio/fmemopen.c (fmemopen_seek): Result must be returned in *P, not the return value. * stdio-common/Makefile (tests): Add tst-fmemopen2. * stdio-common/tst-fmemopen2.c: New file.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/* Fmemopen implementation.
|
||||
Copyright (C) 2000, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Hanno Mueller, kontakt@hanno.de, 2000.
|
||||
|
||||
@ -27,8 +27,6 @@
|
||||
* but couldn't find it in libio. The following snippet of code is an
|
||||
* attempt to implement what glibc's documentation describes.
|
||||
*
|
||||
* No, it isn't really tested yet. :-)
|
||||
*
|
||||
*
|
||||
*
|
||||
* I already see some potential problems:
|
||||
@ -176,9 +174,9 @@ fmemopen_seek (void *cookie, _IO_off64_t *p, int w)
|
||||
if (np < 0 || (size_t) np > c->size)
|
||||
return -1;
|
||||
|
||||
c->pos = np;
|
||||
*p = c->pos = np;
|
||||
|
||||
return np;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user