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
Nadezhda Ivanova
OpenLDAP
Commits
62da0b67
Commit
62da0b67
authored
Apr 25, 2004
by
Kurt Zeilenga
Browse files
AC_STRERROR_R
parent
c63947c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ac/string.h
View file @
62da0b67
...
...
@@ -91,4 +91,17 @@ int (strncasecmp)();
#define STRLENOF(s) (sizeof(s)-1)
#if defined( HAVE_NONPOSIX_STRERROR_R )
# define AC_STRERROR_R(e,b,l) (strerror_r((e), (b), (l)))
#elif defined( HAVE_STRERROR_R )
# define AC_STRERROR_R(e,b,l) (strerror_r((e), (b), (l)) ? (b) : NULL)
#elif defined( HAVE_SYS_ERRLIST )
# define AC_STRERROR_R(e,b,l) ((e) > -1 && (e) < sys_nerr \
? sys_errlist[(e)] : NULL )
#elif defined( HAVE_STRERROR )
# define AC_STRERROR_R(e,b,l) (strerror(e))
#else
# define AC_STRERROR_R(e,b,l) (NULL)
#endif
#endif
/* _AC_STRING_H */
libraries/liblber/sockbuf.c
View file @
62da0b67
...
...
@@ -818,6 +818,7 @@ static ber_slen_t
sb_debug_read
(
Sockbuf_IO_Desc
*
sbiod
,
void
*
buf
,
ber_len_t
len
)
{
ber_slen_t
ret
;
char
ebuf
[
128
];
ret
=
LBER_SBIOD_READ_NEXT
(
sbiod
,
buf
,
len
);
if
(
sbiod
->
sbiod_sb
->
sb_debug
&
LDAP_DEBUG_PACKETS
)
{
...
...
@@ -825,7 +826,7 @@ sb_debug_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len )
if
(
ret
<
0
)
{
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
)
);
(
long
)
len
,
AC_
STRERROR
_R
(
errno
,
ebuf
,
sizeof
ebuf
)
);
}
else
{
ber_log_printf
(
LDAP_DEBUG_PACKETS
,
sbiod
->
sbiod_sb
->
sb_debug
,
"%sread: want=%ld, got=%ld
\n
"
,
(
char
*
)
sbiod
->
sbiod_pvt
,
...
...
@@ -842,6 +843,7 @@ static ber_slen_t
sb_debug_write
(
Sockbuf_IO_Desc
*
sbiod
,
void
*
buf
,
ber_len_t
len
)
{
ber_slen_t
ret
;
char
ebuf
[
128
];
ret
=
LBER_SBIOD_WRITE_NEXT
(
sbiod
,
buf
,
len
);
if
(
sbiod
->
sbiod_sb
->
sb_debug
&
LDAP_DEBUG_PACKETS
)
{
...
...
@@ -850,7 +852,7 @@ sb_debug_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len )
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
)
);
AC_
STRERROR
_R
(
errno
,
ebuf
,
sizeof
ebuf
)
);
}
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