88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.2 2002/10/23 21:16:17 momjian Exp $
11+ * $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.3 2002/10/23 21:39:27 momjian Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -40,16 +40,10 @@ fseeko(FILE *stream, off_t offset, int whence)
4040case SEEK_CUR :
4141flockfile (stream );
4242if (fgetpos (stream ,& floc )!= 0 )
43- {
44- funlockfile (stream );
45- return -1 ;
46- }
43+ gotofailure ;
4744floc += offset ;
4845if (fsetpos (stream ,& floc )!= 0 )
49- {
50- funlockfile (stream );
51- return -1 ;
52- }
46+ gotofailure ;
5347flockfile (stream );
5448return 0 ;
5549break ;
@@ -61,23 +55,21 @@ fseeko(FILE *stream, off_t offset, int whence)
6155case SEEK_END :
6256flockfile (stream );
6357if (fstat (fileno (stream ),& filestat )!= 0 )
64- {
65- funlockfile (stream );
66- return -1 ;
67- }
58+ gotofailure ;
6859floc = filestat .st_size ;
6960if (fsetpos (stream ,& floc )!= 0 )
70- {
71- funlockfile (stream );
72- return -1 ;
73- }
61+ gotofailure ;
7462funlockfile (stream );
7563return 0 ;
7664break ;
7765default :
7866errno = EINVAL ;
7967return -1 ;
8068}
69+
70+ failure :
71+ funlockfile (stream );
72+ return -1 ;
8173}
8274
8375