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
af13640b
Commit
af13640b
authored
5 months ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Use (new) FILE_RETRY_ERRNO() macro to decide to retry sopen()
also retrying fread() and chsize(), but that seems harmless.
parent
ac9c138a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7127
failed
5 months ago
Stage: build
Stage: test
Stage: cleanup
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sbbs3/nopen.c
+1
-1
1 addition, 1 deletion
src/sbbs3/nopen.c
src/smblib/smbfile.c
+2
-2
2 additions, 2 deletions
src/smblib/smbfile.c
src/smblib/smblib.c
+2
-2
2 additions, 2 deletions
src/smblib/smblib.c
with
5 additions
and
5 deletions
src/sbbs3/nopen.c
+
1
−
1
View file @
af13640b
...
...
@@ -48,7 +48,7 @@ int nopen(const char* str, uint access)
access
|=
O_BINARY
;
#endif
while
(((
file
=
sopen
(
str
,
access
,
share
,
DEFFILEMODE
))
==-
1
)
&&
(
errno
==
EACCES
||
errno
==
EAGAIN
||
errno
==
EDEADLOCK
)
&&
count
++<
LOOP_NOPEN
)
&&
FILE_RETRY_ERRNO
(
errno
)
&&
count
++<
LOOP_NOPEN
)
SLEEP
((
count
/
10
)
*
100
);
return
(
file
);
}
...
...
This diff is collapsed.
Click to expand it.
src/smblib/smbfile.c
+
2
−
2
View file @
af13640b
...
...
@@ -84,7 +84,7 @@ size_t smb_fread(smb_t* smb, void* buf, size_t bytes, FILE* fp)
while
(
1
)
{
if
((
ret
=
fread
(
buf
,
sizeof
(
char
),
bytes
,
fp
))
==
bytes
)
return
(
ret
);
if
(
feof
(
fp
)
||
(
get_errno
()
!=
EDEADLOCK
&&
get_errno
()
!=
EACCES
))
if
(
feof
(
fp
)
||
!
FILE_RETRY_ERRNO
(
get_errno
()))
return
(
ret
);
if
(
!
start
)
start
=
time
(
NULL
);
...
...
@@ -144,7 +144,7 @@ int smb_open_fp(smb_t* smb, FILE** fp, int share)
while
(
1
)
{
if
((
file
=
sopen
(
path
,
O_RDWR
|
O_CREAT
|
O_BINARY
,
share
,
DEFFILEMODE
))
!=-
1
)
break
;
if
(
get_errno
()
!=
EACCES
&&
get_errno
()
!=
EAGAIN
)
{
if
(
!
FILE_RETRY_ERRNO
(
get_errno
()
)
)
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s %d '%s' opening %s"
,
__FUNCTION__
,
get_errno
(),
strerror
(
get_errno
()),
path
);
...
...
This diff is collapsed.
Click to expand it.
src/smblib/smblib.c
+
2
−
2
View file @
af13640b
...
...
@@ -240,7 +240,7 @@ int smb_trunchdr(smb_t* smb)
while
(
1
)
{
if
(
chsize
(
fileno
(
smb
->
shd_fp
),
0L
)
==
0
)
break
;
if
(
get_errno
()
!=
EACCES
&&
get_errno
()
!=
EAGAIN
)
{
if
(
!
FILE_RETRY_ERRNO
(
get_errno
()
)
)
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s %d '%s' changing header file size"
,
__FUNCTION__
,
get_errno
(),
strerror
(
get_errno
()));
...
...
@@ -1510,7 +1510,7 @@ int smb_addcrc(smb_t* smb, uint32_t crc)
while
(
1
)
{
if
((
file
=
sopen
(
str
,
O_RDWR
|
O_CREAT
|
O_BINARY
,
SH_DENYRW
,
DEFFILEMODE
))
!=-
1
)
break
;
if
(
get_errno
()
!=
EACCES
&&
get_errno
()
!=
EAGAIN
)
{
if
(
!
FILE_RETRY_ERRNO
(
get_errno
()
)
)
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s %d '%s' opening %s"
,
__FUNCTION__
,
get_errno
(),
strerror
(
get_errno
()),
str
);
...
...
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