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

Commitbb66525

Browse files
committed
Back out flockfile change for NetBSD. Giles Lean reports they are not
supported.
1 parent43057c7 commitbb66525

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎src/port/fseeko.c

Lines changed: 13 additions & 1 deletion
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.9 2003/01/02 23:22:49 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.10 2003/01/11 19:38:23 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -21,7 +21,9 @@
2121

2222
#include"c.h"
2323

24+
#ifdefbsdi
2425
#include<pthread.h>
26+
#endif
2527
#include<stdio.h>
2628
#include<sys/types.h>
2729
#include<sys/stat.h>
@@ -44,13 +46,17 @@ fseeko(FILE *stream, off_t offset, int whence)
4446
switch (whence)
4547
{
4648
caseSEEK_CUR:
49+
#ifdefbsdi
4750
flockfile(stream);
51+
#endif
4852
if (fgetpos(stream,&floc)!=0)
4953
gotofailure;
5054
floc+=offset;
5155
if (fsetpos(stream,&floc)!=0)
5256
gotofailure;
57+
#ifdefbsdi
5358
funlockfile(stream);
59+
#endif
5460
return0;
5561
break;
5662
caseSEEK_SET:
@@ -59,13 +65,17 @@ fseeko(FILE *stream, off_t offset, int whence)
5965
return0;
6066
break;
6167
caseSEEK_END:
68+
#ifdefbsdi
6269
flockfile(stream);
70+
#endif
6371
if (fstat(fileno(stream),&filestat)!=0)
6472
gotofailure;
6573
floc=filestat.st_size;
6674
if (fsetpos(stream,&floc)!=0)
6775
gotofailure;
76+
#ifdefbsdi
6877
funlockfile(stream);
78+
#endif
6979
return0;
7080
break;
7181
default:
@@ -74,7 +84,9 @@ fseeko(FILE *stream, off_t offset, int whence)
7484
}
7585

7686
failure:
87+
#ifdefbsdi
7788
funlockfile(stream);
89+
#endif
7890
return-1;
7991
}
8092

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp