Skip to content

Commit 7e4d435

Browse files
committed
flockfile/funlockfile is POSIX, so NetBSD has them too --- use them.
1 parent 0a02d47 commit 7e4d435

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/02 06:00:33 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.9 2003/01/02 23:22:49 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -21,9 +21,7 @@
2121

2222
#include "c.h"
2323

24-
#ifdef bsdi
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
case SEEK_CUR:
49-
#ifdef bsdi
5047
flockfile(stream);
51-
#endif
5248
if (fgetpos(stream, &floc) != 0)
5349
goto failure;
5450
floc += offset;
5551
if (fsetpos(stream, &floc) != 0)
5652
goto failure;
57-
#ifdef bsdi
5853
funlockfile(stream);
59-
#endif
6054
return 0;
6155
break;
6256
case SEEK_SET:
@@ -65,17 +59,13 @@ fseeko(FILE *stream, off_t offset, int whence)
6559
return 0;
6660
break;
6761
case SEEK_END:
68-
#ifdef bsdi
6962
flockfile(stream);
70-
#endif
7163
if (fstat(fileno(stream), &filestat) != 0)
7264
goto failure;
7365
floc = filestat.st_size;
7466
if (fsetpos(stream, &floc) != 0)
7567
goto failure;
76-
#ifdef bsdi
7768
funlockfile(stream);
78-
#endif
7969
return 0;
8070
break;
8171
default:
@@ -84,9 +74,7 @@ fseeko(FILE *stream, off_t offset, int whence)
8474
}
8575

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

0 commit comments

Comments
 (0)