Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bb66525

Browse files
committed
Back out flockfile change for NetBSD. Giles Lean reports they are not
supported.
1 parent 43057c7 commit bb66525

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+
#ifdef bsdi
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
case SEEK_CUR:
49+
#ifdef bsdi
4750
flockfile(stream);
51+
#endif
4852
if (fgetpos(stream, &floc) != 0)
4953
goto failure;
5054
floc += offset;
5155
if (fsetpos(stream, &floc) != 0)
5256
goto failure;
57+
#ifdef bsdi
5358
funlockfile(stream);
59+
#endif
5460
return 0;
5561
break;
5662
case SEEK_SET:
@@ -59,13 +65,17 @@ fseeko(FILE *stream, off_t offset, int whence)
5965
return 0;
6066
break;
6167
case SEEK_END:
68+
#ifdef bsdi
6269
flockfile(stream);
70+
#endif
6371
if (fstat(fileno(stream), &filestat) != 0)
6472
goto failure;
6573
floc = filestat.st_size;
6674
if (fsetpos(stream, &floc) != 0)
6775
goto failure;
76+
#ifdef bsdi
6877
funlockfile(stream);
78+
#endif
6979
return 0;
7080
break;
7181
default:
@@ -74,7 +84,9 @@ fseeko(FILE *stream, off_t offset, int whence)
7484
}
7585

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

0 commit comments

Comments
 (0)