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
6297136a
Commit
6297136a
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Wrap errno strings in error messages in single-quotes instead of parenthesis.
parent
d3f0a3e0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/smblib/smbadd.c
+6
-6
6 additions, 6 deletions
src/smblib/smbadd.c
src/smblib/smballoc.c
+11
-11
11 additions, 11 deletions
src/smblib/smballoc.c
src/smblib/smbfile.c
+2
-2
2 additions, 2 deletions
src/smblib/smbfile.c
with
19 additions
and
19 deletions
src/smblib/smbadd.c
+
6
−
6
View file @
6297136a
...
...
@@ -172,7 +172,7 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
if
(
xlat
!=
XLAT_NONE
)
{
/* e.g. XLAT_LZH */
if
(
smb_fwrite
(
smb
,
&
xlat
,
sizeof
(
xlat
),
smb
->
sdt_fp
)
!=
sizeof
(
xlat
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing body xlat string"
,
"%d
'
%s
'
writing body xlat string"
,
get_errno
(),
STRERROR
(
get_errno
()));
retval
=
SMB_ERR_WRITE
;
break
;
...
...
@@ -182,7 +182,7 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
xlat
=
XLAT_NONE
;
/* xlat string terminator */
if
(
smb_fwrite
(
smb
,
&
xlat
,
sizeof
(
xlat
),
smb
->
sdt_fp
)
!=
sizeof
(
xlat
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing body xlat terminator"
,
"%d
'
%s
'
writing body xlat terminator"
,
get_errno
(),
STRERROR
(
get_errno
()));
retval
=
SMB_ERR_WRITE
;
break
;
...
...
@@ -191,7 +191,7 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
if
(
smb_fwrite
(
smb
,
body
,
bodylen
,
smb
->
sdt_fp
)
!=
bodylen
)
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing body (%ld bytes)"
,
"%d
'
%s
'
writing body (%ld bytes)"
,
get_errno
(),
STRERROR
(
get_errno
())
,
bodylen
);
retval
=
SMB_ERR_WRITE
;
...
...
@@ -206,7 +206,7 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
xlat
=
XLAT_NONE
;
/* xlat string terminator */
if
(
smb_fwrite
(
smb
,
&
xlat
,
sizeof
(
xlat
),
smb
->
sdt_fp
)
!=
sizeof
(
xlat
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing tail xlat terminator"
,
"%d
'
%s
'
writing tail xlat terminator"
,
get_errno
(),
STRERROR
(
get_errno
()));
retval
=
SMB_ERR_WRITE
;
break
;
...
...
@@ -214,7 +214,7 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
if
(
smb_fwrite
(
smb
,
tail
,
taillen
-
sizeof
(
xlat
),
smb
->
sdt_fp
)
!=
taillen
-
sizeof
(
xlat
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing tail (%ld bytes)"
,
"%d
'
%s
'
writing tail (%ld bytes)"
,
get_errno
(),
STRERROR
(
get_errno
())
,
taillen
-
sizeof
(
xlat
));
retval
=
SMB_ERR_WRITE
;
...
...
@@ -228,7 +228,7 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
}
if
(
l
%
SDT_BLOCK_LEN
)
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing data padding"
,
"%d
'
%s
'
writing data padding"
,
get_errno
(),
STRERROR
(
get_errno
()));
retval
=
SMB_ERR_WRITE
;
break
;
...
...
This diff is collapsed.
Click to expand it.
src/smblib/smballoc.c
+
11
−
11
View file @
6297136a
...
...
@@ -82,7 +82,7 @@ long SMBCALL smb_allocdat(smb_t* smb, ulong length, ushort refs)
for
(
l
=
0
;
l
<
blocks
;
l
++
)
if
(
!
fwrite
(
&
refs
,
sizeof
(
refs
),
1
,
smb
->
sda_fp
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing allocation bytes at offset %ld"
,
"%d
'
%s
'
writing allocation bytes at offset %ld"
,
get_errno
(),
STRERROR
(
get_errno
())
,((
offset
/
SDT_BLOCK_LEN
)
+
l
)
*
sizeof
(
refs
));
return
(
SMB_ERR_WRITE
);
...
...
@@ -121,7 +121,7 @@ long SMBCALL smb_fallocdat(smb_t* smb, ulong length, ushort refs)
fflush
(
smb
->
sda_fp
);
if
(
l
<
blocks
)
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing allocation bytes"
,
"%d
'
%s
'
writing allocation bytes"
,
get_errno
(),
STRERROR
(
get_errno
()));
return
(
SMB_ERR_WRITE
);
}
...
...
@@ -156,7 +156,7 @@ int SMBCALL smb_freemsgdat(smb_t* smb, ulong offset, ulong length, ushort refs)
sda_offset
=
((
offset
/
SDT_BLOCK_LEN
)
+
l
)
*
sizeof
(
i
);
if
(
fseek
(
smb
->
sda_fp
,
sda_offset
,
SEEK_SET
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
seeking to %lu (0x%lX) of allocation file"
,
"%d
'
%s
'
seeking to %lu (0x%lX) of allocation file"
,
get_errno
(),
STRERROR
(
get_errno
())
,
sda_offset
,
sda_offset
);
retval
=
SMB_ERR_SEEK
;
...
...
@@ -164,7 +164,7 @@ int SMBCALL smb_freemsgdat(smb_t* smb, ulong offset, ulong length, ushort refs)
}
if
(
smb_fread
(
smb
,
&
i
,
sizeof
(
i
),
smb
->
sda_fp
)
!=
sizeof
(
i
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
reading allocation bytes at offset %ld"
,
"%d
'
%s
'
reading allocation bytes at offset %ld"
,
get_errno
(),
STRERROR
(
get_errno
())
,
sda_offset
);
retval
=
SMB_ERR_READ
;
...
...
@@ -176,14 +176,14 @@ int SMBCALL smb_freemsgdat(smb_t* smb, ulong offset, ulong length, ushort refs)
i
-=
refs
;
if
(
fseek
(
smb
->
sda_fp
,
-
(
int
)
sizeof
(
i
),
SEEK_CUR
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
seeking backwards 2 bytes in allocation file"
,
"%d
'
%s
'
seeking backwards 2 bytes in allocation file"
,
get_errno
(),
STRERROR
(
get_errno
()));
retval
=
SMB_ERR_SEEK
;
break
;
}
if
(
!
fwrite
(
&
i
,
sizeof
(
i
),
1
,
smb
->
sda_fp
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing allocation bytes at offset %ld"
,
"%d
'
%s
'
writing allocation bytes at offset %ld"
,
get_errno
(),
STRERROR
(
get_errno
())
,
sda_offset
);
retval
=
SMB_ERR_WRITE
;
...
...
@@ -217,7 +217,7 @@ int SMBCALL smb_incdat(smb_t* smb, ulong offset, ulong length, ushort refs)
}
if
(
smb_fread
(
smb
,
&
i
,
sizeof
(
i
),
smb
->
sda_fp
)
!=
sizeof
(
i
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
reading allocation record at offset %ld"
,
"%d
'
%s
'
reading allocation record at offset %ld"
,
get_errno
(),
STRERROR
(
get_errno
())
,((
offset
/
SDT_BLOCK_LEN
)
+
l
)
*
sizeof
(
i
));
return
(
SMB_ERR_READ
);
...
...
@@ -228,7 +228,7 @@ int SMBCALL smb_incdat(smb_t* smb, ulong offset, ulong length, ushort refs)
}
if
(
!
fwrite
(
&
i
,
sizeof
(
i
),
1
,
smb
->
sda_fp
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing allocation record at offset %ld"
,
"%d
'
%s
'
writing allocation record at offset %ld"
,
get_errno
(),
STRERROR
(
get_errno
())
,((
offset
/
SDT_BLOCK_LEN
)
+
l
)
*
sizeof
(
i
));
return
(
SMB_ERR_WRITE
);
...
...
@@ -289,7 +289,7 @@ int SMBCALL smb_freemsghdr(smb_t* smb, ulong offset, ulong length)
for
(
l
=
0
;
l
<
blocks
;
l
++
)
if
(
!
fwrite
(
&
c
,
1
,
1
,
smb
->
sha_fp
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing allocation record"
,
"%d
'
%s
'
writing allocation record"
,
get_errno
(),
STRERROR
(
get_errno
()));
return
(
SMB_ERR_WRITE
);
}
...
...
@@ -372,7 +372,7 @@ long SMBCALL smb_allochdr(smb_t* smb, ulong length)
for
(
l
=
0
;
l
<
blocks
;
l
++
)
if
(
fputc
(
1
,
smb
->
sha_fp
)
!=
1
)
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing allocation record"
,
"%d
'
%s
'
writing allocation record"
,
get_errno
(),
STRERROR
(
get_errno
()));
return
(
SMB_ERR_WRITE
);
}
...
...
@@ -402,7 +402,7 @@ long SMBCALL smb_fallochdr(smb_t* smb, ulong length)
for
(
l
=
0
;
l
<
blocks
;
l
++
)
if
(
!
fwrite
(
&
c
,
1
,
1
,
smb
->
sha_fp
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
writing allocation record"
,
"%d
'
%s
'
writing allocation record"
,
get_errno
(),
STRERROR
(
get_errno
()));
return
(
SMB_ERR_WRITE
);
}
...
...
This diff is collapsed.
Click to expand it.
src/smblib/smbfile.c
+
2
−
2
View file @
6297136a
...
...
@@ -161,7 +161,7 @@ int SMBCALL smb_open_fp(smb_t* smb, FILE** fp, int share)
break
;
if
(
get_errno
()
!=
EACCES
&&
get_errno
()
!=
EAGAIN
)
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
opening %s"
,
"%d
'
%s
'
opening %s"
,
get_errno
(),
STRERROR
(
get_errno
()),
path
);
return
(
SMB_ERR_OPEN
);
}
...
...
@@ -178,7 +178,7 @@ int SMBCALL smb_open_fp(smb_t* smb, FILE** fp, int share)
}
if
((
*
fp
=
fdopen
(
file
,
"r+b"
))
==
NULL
)
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%d
(
%s
)
fdopening %s (%d)"
,
"%d
'
%s
'
fdopening %s (%d)"
,
get_errno
(),
STRERROR
(
get_errno
()),
path
,
file
);
close
(
file
);
return
(
SMB_ERR_OPEN
);
...
...
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