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

Commit7e4d435

Browse files
committed
flockfile/funlockfile is POSIX, so NetBSD has them too --- use them.
1 parent0a02d47 commit7e4d435

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

‎src/port/fseeko.c

Lines changed: 1 addition & 13 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.8 2003/01/0206:00:33 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.9 2003/01/0223:22:49 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -21,9 +21,7 @@
2121

2222
#include"c.h"
2323

24-
#ifdefbsdi
2524
#include<pthread.h>
26-
#endif
2725
#include<stdio.h>
2826
#include<sys/types.h>
2927
#include<sys/stat.h>
@@ -46,17 +44,13 @@ fseeko(FILE *stream, off_t offset, int whence)
4644
switch (whence)
4745
{
4846
caseSEEK_CUR:
49-
#ifdefbsdi
5047
flockfile(stream);
51-
#endif
5248
if (fgetpos(stream,&floc)!=0)
5349
gotofailure;
5450
floc+=offset;
5551
if (fsetpos(stream,&floc)!=0)
5652
gotofailure;
57-
#ifdefbsdi
5853
funlockfile(stream);
59-
#endif
6054
return0;
6155
break;
6256
caseSEEK_SET:
@@ -65,17 +59,13 @@ fseeko(FILE *stream, off_t offset, int whence)
6559
return0;
6660
break;
6761
caseSEEK_END:
68-
#ifdefbsdi
6962
flockfile(stream);
70-
#endif
7163
if (fstat(fileno(stream),&filestat)!=0)
7264
gotofailure;
7365
floc=filestat.st_size;
7466
if (fsetpos(stream,&floc)!=0)
7567
gotofailure;
76-
#ifdefbsdi
7768
funlockfile(stream);
78-
#endif
7969
return0;
8070
break;
8171
default:
@@ -84,9 +74,7 @@ fseeko(FILE *stream, off_t offset, int whence)
8474
}
8575

8676
failure:
87-
#ifdefbsdi
8877
funlockfile(stream);
89-
#endif
9078
return-1;
9179
}
9280

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp