Commit 96cfbc73 authored by rswindell's avatar rswindell
Browse files

Change lock/unlock prototypes to match Borland's and QNX's (long vs int len).

Removed excessive #ifdef __QNX__ blocks.
parent d841f033
......@@ -83,11 +83,7 @@ long DLLCALL filelength(int fd)
}
/* Sets a lock on a portion of a file */
#ifdef __QNX__
int DLLCALL lock(int fd, long pos, long len)
#else /* Not QNX */
int DLLCALL lock(int fd, long pos, int len)
#endif
{
#if defined(F_SANERDLCKNO) || !defined(BSD)
struct flock alock;
......@@ -122,11 +118,7 @@ int DLLCALL lock(int fd, long pos, int len)
}
/* Removes a lock from a file record */
#ifdef __QNX__
int DLLCALL unlock(int fd, long pos, long len)
#else
int DLLCALL unlock(int fd, long pos, int len)
#endif
{
#if defined(F_SANEUNLCK) || !defined(BSD)
......@@ -219,7 +211,7 @@ int DLLCALL sopen(const char *fn, int access, int share, ...)
#define LK_UNLCK LK_UNLOCK
#endif
int DLLCALL lock(int file, long offset, int size)
int DLLCALL lock(int file, long offset, long size)
{
int i;
long pos;
......@@ -233,7 +225,7 @@ int DLLCALL lock(int file, long offset, int size)
return(i);
}
int DLLCALL unlock(int file, long offset, int size)
int DLLCALL unlock(int file, long offset, long size)
{
int i;
long pos;
......
......@@ -72,7 +72,6 @@
#ifdef __QNX__
#include <share.h>
#define L_SET SEEK_SET
#define sopen(x,y,z) qnx_sopen(x,y,z) /* Stupid macro trick */
#else
#define O_TEXT 0 /* all files in binary mode on Unix */
#define O_BINARY 0 /* all files in binary mode on Unix */
......@@ -113,15 +112,13 @@
extern "C" {
#endif
#if !defined(__BORLANDC__) && !defined(__QNX__)
DLLEXPORT int DLLCALL lock(int fd, long pos, int len);
DLLEXPORT int DLLCALL unlock(int fd, long pos, int len);
#if !defined(__BORLANDC__)
DLLEXPORT int DLLCALL lock(int fd, long pos, long len);
DLLEXPORT int DLLCALL unlock(int fd, long pos, long len);
#endif
#if !defined(__BORLANDC__) && defined(__unix__)
#if !defined(__QNX__)
DLLEXPORT int DLLCALL sopen(const char* fn, int access, int share, ...);
#endif
DLLEXPORT long DLLCALL filelength(int fd);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment