aboutsummaryrefslogtreecommitdiff
path: root/libio/fmemopen.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-01-06 00:42:22 +0000
committerUlrich Drepper <drepper@redhat.com>2005-01-06 00:42:22 +0000
commit1e7cceb99ec29742d8d07abfaa39718b3aed65a1 (patch)
treefc794cb1e516284886951adf721f26af93b23098 /libio/fmemopen.c
parent6c4b3f16079c771e92d2e66b3738829d5ccdb55e (diff)
downloadglibc-1e7cceb99ec29742d8d07abfaa39718b3aed65a1.tar
glibc-1e7cceb99ec29742d8d07abfaa39718b3aed65a1.tar.gz
glibc-1e7cceb99ec29742d8d07abfaa39718b3aed65a1.tar.bz2
glibc-1e7cceb99ec29742d8d07abfaa39718b3aed65a1.zip
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.
Diffstat (limited to 'libio/fmemopen.c')
-rw-r--r--libio/fmemopen.c8
1 files changed, 3 insertions, 5 deletions
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;
}