Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
96cfbc73
Commit
96cfbc73
authored
22 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Change lock/unlock prototypes to match Borland's and QNX's (long vs int len).
Removed excessive #ifdef __QNX__ blocks.
parent
d841f033
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/xpdev/filewrap.c
+2
-10
2 additions, 10 deletions
src/xpdev/filewrap.c
src/xpdev/filewrap.h
+3
-6
3 additions, 6 deletions
src/xpdev/filewrap.h
with
5 additions
and
16 deletions
src/xpdev/filewrap.c
+
2
−
10
View file @
96cfbc73
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/xpdev/filewrap.h
+
3
−
6
View file @
96cfbc73
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment