From 79cdb4f9aa4e87854c052a000910c97e49aaa424 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sun, 10 Jan 2010 17:49:01 +0100 Subject: [PATCH] Make forked-daapd build on GNU/kFreeBSD --- src/db.h | 2 +- src/filescanner.c | 12 ++++++------ src/main.c | 8 ++++---- src/transcode.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/db.h b/src/db.h index 67b61fa4..1598b50c 100644 --- a/src/db.h +++ b/src/db.h @@ -222,7 +222,7 @@ struct watch_info { uint32_t cookie; int libidx; -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) void *priv; #endif }; diff --git a/src/filescanner.c b/src/filescanner.c index 1374c33b..e66083a0 100644 --- a/src/filescanner.c +++ b/src/filescanner.c @@ -39,7 +39,7 @@ #if defined(__linux__) # include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # include # include #endif @@ -415,7 +415,7 @@ process_directory(int libidx, char *path, int flags) struct stat sb; #if defined(__linux__) struct watch_info wi; -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct watch_info *wi; struct kevent *kev; #endif @@ -545,7 +545,7 @@ process_directory(int libidx, char *path, int flags) if (!(flags & F_SCAN_RESCAN)) db_watch_add(&wi); -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) wi = (struct watch_info *)malloc(sizeof(struct watch_info)); if (!wi) @@ -1040,7 +1040,7 @@ inotify_cb(int fd, short event, void *arg) #endif /* __linux__ */ -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* Thread: scan */ static void kqueue_cb(int fd, short event, void *arg) @@ -1100,7 +1100,7 @@ kqueue_cb(int fd, short event, void *arg) event_add(&inoev, NULL); } -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ /* Thread: scan */ @@ -1152,7 +1152,7 @@ filescanner_init(void) event_set(&inoev, inofd, EV_READ, inotify_cb, NULL); -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) inofd = kqueue(); if (inofd < 0) diff --git a/src/main.c b/src/main.c index 7fe36291..161facd6 100644 --- a/src/main.c +++ b/src/main.c @@ -40,7 +40,7 @@ #if defined(__linux__) # include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # include # include #endif @@ -333,7 +333,7 @@ signal_signalfd_cb(int fd, short event, void *arg) event_add(&sig_event, NULL); } -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) static void signal_kqueue_cb(int fd, short event, void *arg) @@ -394,7 +394,7 @@ main(int argc, char **argv) char *pidfile; sigset_t sigs; int sigfd; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct kevent ke_sigs[4]; #endif int ret; @@ -610,7 +610,7 @@ main(int argc, char **argv) event_set(&sig_event, sigfd, EV_READ, signal_signalfd_cb, NULL); -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) sigfd = kqueue(); if (sigfd < 0) { diff --git a/src/transcode.c b/src/transcode.c index cd2a11ee..28d24ca9 100644 --- a/src/transcode.c +++ b/src/transcode.c @@ -34,7 +34,7 @@ #if defined(__linux__) # include # include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # include #endif