Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit586510f

Browse files
committed
Improve coding style of new function.
1 parent6b9d496 commit586510f

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

‎src/port/fseeko.c

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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)
4040
caseSEEK_CUR:
4141
flockfile(stream);
4242
if (fgetpos(stream,&floc)!=0)
43-
{
44-
funlockfile(stream);
45-
return-1;
46-
}
43+
gotofailure;
4744
floc+=offset;
4845
if (fsetpos(stream,&floc)!=0)
49-
{
50-
funlockfile(stream);
51-
return-1;
52-
}
46+
gotofailure;
5347
flockfile(stream);
5448
return0;
5549
break;
@@ -61,23 +55,21 @@ fseeko(FILE *stream, off_t offset, int whence)
6155
caseSEEK_END:
6256
flockfile(stream);
6357
if (fstat(fileno(stream),&filestat)!=0)
64-
{
65-
funlockfile(stream);
66-
return-1;
67-
}
58+
gotofailure;
6859
floc=filestat.st_size;
6960
if (fsetpos(stream,&floc)!=0)
70-
{
71-
funlockfile(stream);
72-
return-1;
73-
}
61+
gotofailure;
7462
funlockfile(stream);
7563
return0;
7664
break;
7765
default:
7866
errno=EINVAL;
7967
return-1;
8068
}
69+
70+
failure:
71+
funlockfile(stream);
72+
return-1;
8173
}
8274

8375

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp