A simpler way to do the same thing.
This commit was SVN r5063.
Этот коммит содержится в:
родитель
1826e3c445
Коммит
6f0b7d3cac
@ -975,15 +975,6 @@ AC_DEFINE_UNQUOTED(OMPI_HAVE_SA_LEN, $VALUE,
|
||||
[Whether we have the sa_len struct in <sys/socket.h> or not])
|
||||
AC_MSG_RESULT([$MSG])
|
||||
|
||||
# IFADDR_NONE
|
||||
AC_MSG_CHECKING([for INADDR_NONE])
|
||||
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT]],
|
||||
[[unsigned long inaddr = INADDR_NONE;]]),
|
||||
[MSG=yes VALUE=1], [MSG=no VALUE=0])
|
||||
AC_DEFINE_UNQUOTED(OMPI_HAVE_INADDR_NONE, $VALUE,
|
||||
[Whether we have INADDR_NONE constant or not])
|
||||
AC_MSG_RESULT([$MSG])
|
||||
|
||||
# union semun in sys/sem.h
|
||||
|
||||
# Note that sometimes we have <stdbool.h>, but it doesn't work (e.g.,
|
||||
|
@ -234,18 +234,22 @@ extern "C" {
|
||||
# define vsnprintf ompi_vsnprintf
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define IFADDR_NONE if we don't have it. Solaris is the only system
|
||||
* where I have found that it does not exist, and the man page for
|
||||
* inet_addr() says that it returns -1 upon failure. On Linux and
|
||||
* other systems with IFADDR_NONE, it's just a #define to -1 anyway.
|
||||
* So just #define it to -1 here if it doesn't already exist.
|
||||
*/
|
||||
|
||||
#ifndef IFADDR_NONE
|
||||
#define IFADDR_NONE -1
|
||||
#endif
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define __func__-preprocessor directive if the compiler does not
|
||||
* already define it. Define it to __FILE__ so that we at least have
|
||||
* a clue where the developer is trying to indicate where the error is
|
||||
* coming from (assuming that __func__ is typically used for
|
||||
* printf-style debugging).
|
||||
*/
|
||||
|
||||
#if !HAVE_DECL___FUNC__
|
||||
#define __func__ __FILE__
|
||||
#endif
|
||||
|
@ -431,13 +431,7 @@ int ompi_ifaddrtoname(const char* if_addr, char* if_name, int length)
|
||||
return rc;
|
||||
}
|
||||
|
||||
if(
|
||||
#if OMPI_HAVE_INADDR_NONE
|
||||
INADDR_NONE == inaddr
|
||||
#else
|
||||
-1 == inaddr
|
||||
#endif
|
||||
) {
|
||||
if(INADDR_NONE == inaddr) {
|
||||
h = gethostbyname(if_addr);
|
||||
if(0 == h) {
|
||||
ompi_output(0,"ompi_ifaddrtoname: unable to resolve %s\n", if_addr);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user