From 1e7cceb99ec29742d8d07abfaa39718b3aed65a1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 6 Jan 2005 00:42:22 +0000 Subject: 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. --- libio/fmemopen.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libio/fmemopen.c') diff --git a/libio/fmemopen.c b/libio/fmemopen.c index ab6ffdd678..265b848ebe 100644 --- a/libio/fmemopen.c +++ b/libio/fmemopen.c @@ -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; } -- cgit 1.4.1