Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Christopher Ng
OpenLDAP
Commits
9f0d1907
Commit
9f0d1907
authored
24 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Add ldap_pvt_gai_strerror().
Calls to gai_strerror() should be replaced with calls AC_GAI_STRERROR().
parent
3498151f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ac/socket.h
+9
-0
9 additions, 0 deletions
include/ac/socket.h
libraries/libldap/util-int.c
+36
-0
36 additions, 0 deletions
libraries/libldap/util-int.c
with
45 additions
and
0 deletions
include/ac/socket.h
+
9
−
0
View file @
9f0d1907
...
...
@@ -193,4 +193,13 @@ LDAP_F (int) ldap_pvt_inet_aton LDAP_P(( const char *, struct in_addr * ));
# define INET6_ADDRSTRLEN 46
#endif
#ifdef HAVE_GETADDRINFO
# ifdef HAVE_GAI_STRERROR
# define AC_GAI_STRERROR(x) (gai_strerror((x)))
# else
# define AC_GAI_STRERROR(x) (ldap_pvt_gai_strerror((x)))
char
*
ldap_pvt_gai_strerror
(
int
);
# endif
#endif
#endif
/* _AC_SOCKET_H_ */
This diff is collapsed.
Click to expand it.
libraries/libldap/util-int.c
+
36
−
0
View file @
9f0d1907
...
...
@@ -413,3 +413,39 @@ char * ldap_pvt_get_fqdn( char *name )
LDAP_FREE
(
ha_buf
);
return
fqdn
;
}
#if defined( HAVE_GETADDRINFO ) && !defined( HAVE_GAI_STRERROR )
char
*
ldap_pvt_gai_strerror
(
int
code
)
{
static
struct
{
int
code
;
const
char
*
msg
;
}
values
[]
=
{
#ifdef EAI_ADDRFAMILY
{
EAI_ADDRFAMILY
,
"Address family for hostname not supported"
},
#endif
{
EAI_AGAIN
,
"Temporary failure in name resolution"
},
{
EAI_BADFLAGS
,
"Bad value for ai_flags"
},
{
EAI_FAIL
,
"Non-recoverable failure in name resolution"
},
{
EAI_FAMILY
,
"ai_family not supported"
},
{
EAI_MEMORY
,
"Memory allocation failure"
},
#ifdef EAI_NODATA
{
EAI_NODATA
,
"No address associated with hostname"
},
#endif
{
EAI_NONAME
,
"Name or service not known"
},
{
EAI_SERVICE
,
"Servname not supported for ai_socktype"
},
{
EAI_SOCKTYPE
,
"ai_socktype not supported"
},
{
EAI_SYSTEM
,
"System error"
},
{
0
,
NULL
}
};
int
i
;
for
(
i
=
0
;
values
[
i
].
msg
!=
NULL
;
i
++
)
{
if
(
values
[
i
].
code
==
code
)
{
return
(
char
*
)
values
[
i
].
msg
;
}
}
return
"Unknown error"
;
}
#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