Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
d8e70bd5
Commit
d8e70bd5
authored
Dec 31, 2001
by
Howard Chu
Browse files
in sb_debug_read/write save errno before logging a failure.
ber_log_printf can cause errors of its own and obscure the original.
parent
e823c748
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblber/sockbuf.c
View file @
d8e70bd5
...
...
@@ -822,10 +822,11 @@ sb_debug_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len )
if
(
sbiod
->
sbiod_sb
->
sb_debug
&
LDAP_DEBUG_PACKETS
)
{
if
(
ret
<
0
)
{
int
err
=
errno
;
ber_log_printf
(
LDAP_DEBUG_PACKETS
,
sbiod
->
sbiod_sb
->
sb_debug
,
"%sread: want=%ld error=%s
\n
"
,
(
char
*
)
sbiod
->
sbiod_pvt
,
(
long
)
len
,
STRERROR
(
errno
)
);
errno
=
err
;
}
else
{
ber_log_printf
(
LDAP_DEBUG_PACKETS
,
sbiod
->
sbiod_sb
->
sb_debug
,
"%sread: want=%ld, got=%ld
\n
"
,
(
char
*
)
sbiod
->
sbiod_pvt
,
...
...
@@ -846,11 +847,12 @@ sb_debug_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len )
if
(
sbiod
->
sbiod_sb
->
sb_debug
&
LDAP_DEBUG_PACKETS
)
{
if
(
ret
<
0
)
{
int
err
=
errno
;
ber_log_printf
(
LDAP_DEBUG_PACKETS
,
sbiod
->
sbiod_sb
->
sb_debug
,
"%swrite: want=%ld error=%s
\n
"
,
(
char
*
)
sbiod
->
sbiod_pvt
,
(
long
)
len
,
STRERROR
(
errno
)
);
errno
=
err
;
}
else
{
ber_log_printf
(
LDAP_DEBUG_PACKETS
,
sbiod
->
sbiod_sb
->
sb_debug
,
"%swrite: want=%ld, written=%ld
\n
"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment