Commit a9ed7f3d authored by dermiste's avatar dermiste

portability fixes

parent 41a83435
......@@ -111,7 +111,7 @@ main(int argc, char **argv)
gettime(&now);
rfd = open("/dev/urandom", O_RDONLY);
rfd = open(RND_DEV, O_RDONLY);
if(rfd < 0) {
perror("open(random)");
} else {
......
......@@ -80,6 +80,14 @@ THE SOFTWARE.
#endif
#endif
#if defined(__linux)
#define RND_DEV "/dev/urandom"
#elif defined(__OpenBSD__)
#define RND_DEV "/dev/arandom"
#else
#error "don't know which random device to use"
#endif
extern struct timeval now;
extern int debug;
extern time_t reboot_time;
......
......@@ -24,7 +24,7 @@ THE SOFTWARE.
#include <string.h>
#include <stdio.h>
#ifndef __APPLE__
#ifdef __linux
/* Defining it rather than including <linux/rtnetlink.h> because this
* implies <asm/types.h> on Linux 2.4 */
#define RTPROT_BOOT 3 /* Route installed during boot */
......@@ -646,7 +646,7 @@ filter_match(struct filter *f, const unsigned char *id,
return 0;
} else if(proto == RTPROT_BABEL_LOCAL) {
return 0;
#ifndef __APPLE__
#ifdef __linux
} else if(proto == RTPROT_BOOT) {
return 0;
#endif
......
......@@ -26,10 +26,10 @@ THE SOFTWARE.
#include "babeld.h"
#ifdef __APPLE__
#include "kernel_socket.c"
#else
#ifdef __linux
#include "kernel_netlink.c"
#else
#include "kernel_socket.c"
#endif
/* Like gettimeofday, but returns monotonic time. If POSIX clocks are not
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment