aboutsummaryrefslogtreecommitdiff
path: root/libio/iofgetpos64.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/iofgetpos64.c')
-rw-r--r--libio/iofgetpos64.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libio/iofgetpos64.c b/libio/iofgetpos64.c
index 3f29337c7d..179071894e 100644
--- a/libio/iofgetpos64.c
+++ b/libio/iofgetpos64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995-2000, 2001 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
@@ -42,7 +42,10 @@ _IO_new_fgetpos64 (fp, posp)
_IO_flockfile (fp);
pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
if (_IO_in_backup (fp))
- pos -= fp->_IO_save_end - fp->_IO_save_base;
+ {
+ if (fp->_mode <= 0)
+ pos -= fp->_IO_save_end - fp->_IO_save_base;
+ }
_IO_funlockfile (fp);
_IO_cleanup_region_end (0);
if (pos == _IO_pos_BAD)