summary refs log tree commit diff
path: root/libio/iofgetpos64.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-08-30 00:24:07 +0000
committerUlrich Drepper <drepper@redhat.com>2003-08-30 00:24:07 +0000
commitbc2e36893ac897047556babee5f7eb8eee7003aa (patch)
tree46e2637a07005bfa7d3872b2790f846530eaff94 /libio/iofgetpos64.c
parent0261d33f8745765a829fe5d59cd4dc6534bcd1b3 (diff)
downloadglibc-bc2e36893ac897047556babee5f7eb8eee7003aa.tar.gz
glibc-bc2e36893ac897047556babee5f7eb8eee7003aa.tar.xz
glibc-bc2e36893ac897047556babee5f7eb8eee7003aa.zip
Update.
2003-08-28  Carlos O'Donell  <carlos@baldric.uwo.ca>

	* sysdeps/unix/sysv/linux/hppa/syscalls.list: Add semtimedop.

2003-08-29  Jakub Jelinek  <jakub@redhat.com>

	* libio/iofgetpos64.c (_IO_new_fgetpos64): Move lock release to the
	end.

2003-08-29  Ulrich Drepper  <drepper@redhat.com>

	* libio/stdio.h: Remove a few more __THROW.

	* libio/iofputs.c (_IO_fputs): Likewise.
	* libio/iofputws.c (fputws): Likewise.
Diffstat (limited to 'libio/iofgetpos64.c')
-rw-r--r--libio/iofgetpos64.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/libio/iofgetpos64.c b/libio/iofgetpos64.c
index 029556f8cd..be224ca103 100644
--- a/libio/iofgetpos64.c
+++ b/libio/iofgetpos64.c
@@ -37,6 +37,7 @@ _IO_new_fgetpos64 (fp, posp)
 {
 #ifdef _G_LSEEK64
   _IO_off64_t pos;
+  int result = 0;
   CHECK_FILE (fp, EOF);
   _IO_acquire_lock (fp);
   pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
@@ -45,7 +46,6 @@ _IO_new_fgetpos64 (fp, posp)
       if (fp->_mode <= 0)
 	pos -= fp->_IO_save_end - fp->_IO_save_base;
     }
-  _IO_release_lock (fp);
   if (pos == _IO_pos_BAD)
     {
       /* ANSI explicitly requires setting errno to a positive value on
@@ -54,14 +54,18 @@ _IO_new_fgetpos64 (fp, posp)
       if (errno == 0)
 	__set_errno (EIO);
 # endif
-      return EOF;
+      result = EOF;
+    }
+  else
+    {
+      posp->__pos = pos;
+      if (fp->_mode > 0
+	  && (*fp->_codecvt->__codecvt_do_encoding) (fp->_codecvt) < 0)
+	/* This is a stateful encoding, safe the state.  */
+	posp->__state = fp->_wide_data->_IO_state;
     }
-  posp->__pos = pos;
-  if (fp->_mode > 0
-      && (*fp->_codecvt->__codecvt_do_encoding) (fp->_codecvt) < 0)
-    /* This is a stateful encoding, safe the state.  */
-    posp->__state = fp->_wide_data->_IO_state;
-  return 0;
+  _IO_release_lock (fp);
+  return result;
 #else
   __set_errno (ENOSYS);
   return EOF;