Skip to content
Snippets Groups Projects
Commit ef82464d authored by deuce's avatar deuce
Browse files

Fix bugs in last commit

parent 47e3a06f
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
#endif
......@@ -354,9 +355,9 @@ long filelength(int fd)
/* Sets a lock on a portion of a file */
#ifdef __QNX__
int DLLCALL lock(int fd, long pos, long len)
int lock(int fd, long pos, long len)
#else /* Not QNX */
int DLLCALL lock(int fd, long pos, int len)
int lock(int fd, long pos, int len)
#endif
{
#if defined(F_SANERDLCKNO) || !defined(BSD)
......@@ -393,9 +394,9 @@ 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)
int unlock(int fd, long pos, long len)
#else
int DLLCALL unlock(int fd, long pos, int len)
int unlock(int fd, long pos, int len)
#endif
{
......@@ -424,14 +425,14 @@ int DLLCALL unlock(int fd, long pos, int len)
/* Opens a file in specified sharing (file-locking) mode */
#ifdef __QNX__
int DLLCALL qnx_sopen(char *fn, int access, int share)
int qnx_sopen(char *fn, int access, int share)
{
#undef sopen /* Stupid macro trick */
return(sopen(fn, access, share, S_IREAD|S_IWRITE));
#define sopen(x,y,z) qnx_sopen(x,y,z)
}
#else
int DLLCALL sopen(char *fn, int access, int share)
int sopen(char *fn, int access, int share)
{
int fd;
#ifndef F_SANEWRLCKNO
......
......@@ -140,9 +140,11 @@
#define O_BINARY 0 /* all files in binary mode on Unix */
#define O_DENYNONE (1<<31) /* req'd for Baja/nopen compatibility */
#ifndef __QNX__
#define SH_DENYNO 2 // no locks
#define SH_DENYRW F_WRLCK // exclusive lock
#define SH_DENYWR F_RDLCK // shareable lock
#endif
#define stricmp(x,y) strcasecmp(x,y)
#define strnicmp(x,y,z) strncasecmp(x,y,z)
......@@ -203,8 +205,10 @@
#define tell(fd) lseek(fd,0,SEEK_CUR)
#ifdef __QNX__
#include <share.h>
int qnx_sopen(char *fn, int access, int share);
#define sopen(x,y,z) qnx_sopen(x,y,z)
#define L_SET SEEK_SET
#else
int sopen(char *fn, int access, int share);
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment