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
c2f0aded
Commit
c2f0aded
authored
3 months ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Move the xp_lockfile() into a compile block that includes Borland
parent
c88cfced
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7335
failed
3 months ago
Stage: build
Stage: test
Stage: cleanup
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xpdev/filewrap.c
+19
-16
19 additions, 16 deletions
src/xpdev/filewrap.c
with
19 additions
and
16 deletions
src/xpdev/filewrap.c
+
19
−
16
View file @
c2f0aded
...
...
@@ -249,22 +249,6 @@ int sopen(const char *fn, int sh_access, int share, ...)
#define LK_UNLCK LK_UNLOCK
#endif
int
xp_lockfile
(
int
file
,
off_t
offset
,
off_t
size
,
bool
block
)
{
int
i
;
off_t
pos
;
pos
=
tell
(
file
);
if
(
offset
!=
pos
)
(
void
)
lseek
(
file
,
offset
,
SEEK_SET
);
do
{
i
=
_locking
(
file
,
block
?
LK_LOCK
:
LK_NBLCK
,
(
long
)
size
);
}
while
(
block
&&
i
!=
0
&&
errno
==
EDEADLOCK
);
if
(
offset
!=
pos
)
(
void
)
lseek
(
file
,
pos
,
SEEK_SET
);
return
(
i
);
}
int
unlock
(
int
file
,
off_t
offset
,
off_t
size
)
{
int
i
;
...
...
@@ -426,3 +410,22 @@ FILE *_fsopen(const char *pszFilename, const char *pszMode, int shmode)
#endif
}
#endif
#ifdef _WIN32
int
xp_lockfile
(
int
file
,
off_t
offset
,
off_t
size
,
bool
block
)
{
int
i
;
off_t
pos
;
pos
=
tell
(
file
);
if
(
offset
!=
pos
)
(
void
)
lseek
(
file
,
offset
,
SEEK_SET
);
do
{
i
=
_locking
(
file
,
block
?
LK_LOCK
:
LK_NBLCK
,
(
long
)
size
);
}
while
(
block
&&
i
!=
0
&&
errno
==
EDEADLOCK
);
if
(
offset
!=
pos
)
(
void
)
lseek
(
file
,
pos
,
SEEK_SET
);
return
(
i
);
}
#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