From ab18a3629f693b63b8c0134f728819efea91f7b6 Mon Sep 17 00:00:00 2001 From: Nysal Jan Date: Thu, 2 Apr 2009 18:35:09 +0000 Subject: [PATCH] Change the return type to handle the case where an invalid interface name is passed to this function. This commit was SVN r20933. --- opal/util/if.c | 4 ++-- opal/util/if.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opal/util/if.c b/opal/util/if.c index 8273104892..c80329104f 100644 --- a/opal/util/if.c +++ b/opal/util/if.c @@ -865,7 +865,7 @@ int opal_ifnametoindex(const char* if_name) * corresponding kernel index. */ -uint16_t opal_ifnametokindex(const char* if_name) +int16_t opal_ifnametokindex(const char* if_name) { opal_if_t* intf; int rc = opal_ifinit(); @@ -1230,7 +1230,7 @@ opal_ifnametoindex(const char* if_name) return OPAL_ERR_NOT_SUPPORTED; } -uint16_t +int16_t opal_ifnametokindex(const char* if_name) { return OPAL_ERR_NOT_SUPPORTED; diff --git a/opal/util/if.h b/opal/util/if.h index 188840b7ff..55483ec55d 100644 --- a/opal/util/if.h +++ b/opal/util/if.h @@ -77,7 +77,7 @@ OPAL_DECLSPEC int opal_ifnametoindex(const char* if_name); * @param if_name (IN) Interface name * @return Interface kernel index */ -OPAL_DECLSPEC uint16_t opal_ifnametokindex(const char* if_name); +OPAL_DECLSPEC int16_t opal_ifnametokindex(const char* if_name); /** * Lookup an interface by opal_list index and return its kernel index.