]> sourceware.org Git - glibc.git/commitdiff
* sysdeps/unix/seekdir.c: Don't modify POS before seeking. cvs/libc-960117
authorRoland McGrath <roland@gnu.org>
Wed, 17 Jan 1996 10:00:23 +0000 (10:00 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 17 Jan 1996 10:00:23 +0000 (10:00 +0000)
* sysdeps/unix/telldir.c: Fix position calculation to account for
buffered data properly.

ChangeLog
sysdeps/unix/seekdir.c
sysdeps/unix/telldir.c

index 769fa1636d2e64403cfef959c109865dc51129d3..eedcc2b83422d193558cfdba4a3480ecbb055ee3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 Tue Jan 16 17:37:39 1996  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
 
+       * sysdeps/unix/seekdir.c: Don't modify POS before seeking.
+       * sysdeps/unix/telldir.c: Fix position calculation to account for
+       buffered data properly.
+
        * sysdeps/m68k/Makefile (crypt): Don't define if building a shared
        library.
 
index b0a6f5e9d77947914311efb2b058f42c5120dd88..018f697c21e70b717fa58309f924cad0d5a0182e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,6 @@ Cambridge, MA 02139, USA.  */
 void
 DEFUN(seekdir, (dirp, pos), DIR *dirp AND __off_t pos)
 {
-  pos -= dirp->__size - dirp->__offset;
   (void) __lseek(dirp->__fd, pos, SEEK_SET);
   dirp->__size = 0;
   dirp->__offset = 0;
index 5dbf1ca3c1d4fde4d80e12b3a18dad7a65b24386..2b611b0fcae968c055c05bfa294f6a971a943a6e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -39,5 +39,5 @@ DEFUN(telldir, (dirp), DIR *dirp)
   pos = __lseek(dirp->__fd, (off_t) 0, SEEK_CUR);
   if (pos == (off_t) -1)
     return (off_t) -1;
-  return pos + (dirp->__size - dirp->__offset);
+  return pos + dirp->__size - dirp->__offset;
 }
This page took 0.049403 seconds and 5 git commands to generate.