mirror of https://github.com/BOINC/boinc.git
Added replacement for ether_ntoa() on hosts that don't have it.
This commit is contained in:
parent
8f7e94ec5d
commit
8537d45bdf
|
@ -17,10 +17,6 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// 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 <vector>
|
#include <vector>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
@ -29,6 +25,29 @@
|
||||||
|
|
||||||
#include "unix_util.h"
|
#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<char *> envstrings;
|
static std::vector<char *> envstrings;
|
||||||
|
|
||||||
// In theory setenv() is posix, but some implementations of unix
|
// In theory setenv() is posix, but some implementations of unix
|
||||||
|
|
Loading…
Reference in New Issue