diff --git a/lib/unix_util.cpp b/lib/unix_util.cpp index 8c628c9862..76f71f8c6f 100644 --- a/lib/unix_util.cpp +++ b/lib/unix_util.cpp @@ -17,10 +17,6 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -// Note. This already has an ifdef around it. If it is causing problem -// then HAVE_SETENV should be defined in your configuration files. -#ifndef HAVE_SETENV - #include #include #include @@ -29,6 +25,29 @@ #include "unix_util.h" +// Note. This already has an ifdef around it. If it is causing problem +// then HAVE_ETHER_NTOA should be defined in your configuration files. +#ifndef HAVE_ETHER_NTOA +extern "C" { +static char ether_ntoa_buffer[18]; + +char *ether_ntoa(const struct ether_addr *addr) { + int i; + for (i=0;i<5;i++) { + sprintf(ether_ntoa_buffer+i*3,"%0.2x:",addr->ether_addr_octet[i]); + } + sprintf(ether_ntoa_buffer+15,"%0.2x",addr->ether_addr_octet[i]); + return ether_ntoa_buffer; +} +} +#endif + +// Note. This already has an ifdef around it. If it is causing problem +// then HAVE_SETENV should be defined in your configuration files. +#ifndef HAVE_SETENV + + + static std::vector envstrings; // In theory setenv() is posix, but some implementations of unix