[evoke] r1255 committed - * Wrap some freebsd specific elements in #if defined blocks. This will...

0 views
Skip to first unread message

codesite...@google.com

unread,
Oct 16, 2009, 8:48:11 PM10/16/09
to evoke-...@googlegroups.com
Revision: 1255
Author: heliocentric
Date: Fri Oct 16 17:47:30 2009
Log: * Wrap some freebsd specific elements in #if defined blocks. This will
help support porting to other ABI's


http://code.google.com/p/evoke/source/detail?r=1255

Modified:
/trunk/builder/targets/FreeBSD/share/nlib/libevoke/evoke.h
/trunk/builder/targets/FreeBSD/share/nsrc/nexusd/nexusd.c

=======================================
--- /trunk/builder/targets/FreeBSD/share/nlib/libevoke/evoke.h Tue Sep 1
19:59:30 2009
+++ /trunk/builder/targets/FreeBSD/share/nlib/libevoke/evoke.h Fri Oct 16
17:47:30 2009
@@ -1,5 +1,9 @@
#include <time.h>
-#include <sys/timespec.h>
+
+#if defined(__FreeBSD__)
+# include <sys/timespec.h>
+#endif
+
#include <sys/types.h>
#include <timeconv.h>
#include <sys/sysctl.h>
=======================================
--- /trunk/builder/targets/FreeBSD/share/nsrc/nexusd/nexusd.c Fri Oct 2
10:19:50 2009
+++ /trunk/builder/targets/FreeBSD/share/nsrc/nexusd/nexusd.c Fri Oct 16
17:47:30 2009
@@ -32,7 +32,6 @@
#include <sys/wait.h>
#include <sys/rtprio.h>
#include <sys/sysctl.h>
-#include <sys/watchdog.h>
#include <fcntl.h>
#include <libutil.h>
#include <stdio.h>
@@ -52,6 +51,10 @@
#include <sys/ktrace.h>
#include <ctype.h>

+#if defined(__FreeBSD__)
+# include <sys/watchdog.h>
+#endif
+
#include <evoke.h>

#define HEX_DIGEST_LENGTH 65
@@ -72,11 +75,12 @@
#define DEFAULT_POLL_INTERVAL 250 /* Poll interval in milliseconds */

int startwatchdogd(pid_t * watchdogdpid);
+#if defined(__FreeBSD__)
int watchdoginit(int * fd);
int watchdogpat(int fd, u_int timeout);
int watchdogonoff(int fd, u_int timeout, int onoff);
int watchdogloop(int fd, u_int timeout);
-
+#endif
int startdevd(pid_t * devdpid);

int startsystem(pid_t * systartpid, int mode);
@@ -231,9 +235,10 @@
printf("Unable to enable tracing on nexusd\n");
}
}
+#if defined(__FreeBSD__)
pid_t watchdogd_pid;
startwatchdogd(&watchdogd_pid);
-
+#endif
pid_t powerd_pid;
startpowerd(&powerd_pid);

@@ -353,6 +358,7 @@
}


+#if defined(__FreeBSD__)
int startwatchdogd(pid_t * watchdogdpid) {
struct rtprio rtp;
int watchdog_fd;
@@ -423,6 +429,7 @@
sleep(1);
}
}
+#endif

int startdevd(pid_t * devdpid) {
return 0;

Reply all
Reply to author
Forward
0 new messages