mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-16 09:13:18 -05:00
Make forked-daapd build on GNU/kFreeBSD
This commit is contained in:
parent
d96cdd7400
commit
79cdb4f9aa
2
src/db.h
2
src/db.h
@ -222,7 +222,7 @@ struct watch_info {
|
|||||||
uint32_t cookie;
|
uint32_t cookie;
|
||||||
int libidx;
|
int libidx;
|
||||||
|
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
void *priv;
|
void *priv;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
# include <sys/inotify.h>
|
# include <sys/inotify.h>
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# include <sys/event.h>
|
# include <sys/event.h>
|
||||||
#endif
|
#endif
|
||||||
@ -415,7 +415,7 @@ process_directory(int libidx, char *path, int flags)
|
|||||||
struct stat sb;
|
struct stat sb;
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
struct watch_info wi;
|
struct watch_info wi;
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
struct watch_info *wi;
|
struct watch_info *wi;
|
||||||
struct kevent *kev;
|
struct kevent *kev;
|
||||||
#endif
|
#endif
|
||||||
@ -545,7 +545,7 @@ process_directory(int libidx, char *path, int flags)
|
|||||||
if (!(flags & F_SCAN_RESCAN))
|
if (!(flags & F_SCAN_RESCAN))
|
||||||
db_watch_add(&wi);
|
db_watch_add(&wi);
|
||||||
|
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
|
||||||
wi = (struct watch_info *)malloc(sizeof(struct watch_info));
|
wi = (struct watch_info *)malloc(sizeof(struct watch_info));
|
||||||
if (!wi)
|
if (!wi)
|
||||||
@ -1040,7 +1040,7 @@ inotify_cb(int fd, short event, void *arg)
|
|||||||
#endif /* __linux__ */
|
#endif /* __linux__ */
|
||||||
|
|
||||||
|
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
/* Thread: scan */
|
/* Thread: scan */
|
||||||
static void
|
static void
|
||||||
kqueue_cb(int fd, short event, void *arg)
|
kqueue_cb(int fd, short event, void *arg)
|
||||||
@ -1100,7 +1100,7 @@ kqueue_cb(int fd, short event, void *arg)
|
|||||||
|
|
||||||
event_add(&inoev, NULL);
|
event_add(&inoev, NULL);
|
||||||
}
|
}
|
||||||
#endif /* __FreeBSD__ */
|
#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
|
||||||
|
|
||||||
|
|
||||||
/* Thread: scan */
|
/* Thread: scan */
|
||||||
@ -1152,7 +1152,7 @@ filescanner_init(void)
|
|||||||
|
|
||||||
event_set(&inoev, inofd, EV_READ, inotify_cb, NULL);
|
event_set(&inoev, inofd, EV_READ, inotify_cb, NULL);
|
||||||
|
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
|
||||||
inofd = kqueue();
|
inofd = kqueue();
|
||||||
if (inofd < 0)
|
if (inofd < 0)
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
# include <sys/signalfd.h>
|
# include <sys/signalfd.h>
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# include <sys/event.h>
|
# include <sys/event.h>
|
||||||
#endif
|
#endif
|
||||||
@ -333,7 +333,7 @@ signal_signalfd_cb(int fd, short event, void *arg)
|
|||||||
event_add(&sig_event, NULL);
|
event_add(&sig_event, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
signal_kqueue_cb(int fd, short event, void *arg)
|
signal_kqueue_cb(int fd, short event, void *arg)
|
||||||
@ -394,7 +394,7 @@ main(int argc, char **argv)
|
|||||||
char *pidfile;
|
char *pidfile;
|
||||||
sigset_t sigs;
|
sigset_t sigs;
|
||||||
int sigfd;
|
int sigfd;
|
||||||
#ifdef __FreeBSD__
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
struct kevent ke_sigs[4];
|
struct kevent ke_sigs[4];
|
||||||
#endif
|
#endif
|
||||||
int ret;
|
int ret;
|
||||||
@ -610,7 +610,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
event_set(&sig_event, sigfd, EV_READ, signal_signalfd_cb, NULL);
|
event_set(&sig_event, sigfd, EV_READ, signal_signalfd_cb, NULL);
|
||||||
|
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
sigfd = kqueue();
|
sigfd = kqueue();
|
||||||
if (sigfd < 0)
|
if (sigfd < 0)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
# include <endian.h>
|
# include <endian.h>
|
||||||
# include <byteswap.h>
|
# include <byteswap.h>
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
# include <sys/endian.h>
|
# include <sys/endian.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user