summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGary <admin@garyshood.com>2013-07-23 00:07:23 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2013-07-25 22:33:24 -0500
commit9ebd5a6aff73d70717f1d9a2f57767eae3eeb0c8 (patch)
tree0732c859b154ef706762cc205170cd2808230dfa /src
parentbee59c68c5ff5be426e68ecb603d4cc26542f4af (diff)
downloadopenrc-9ebd5a6aff73d70717f1d9a2f57767eae3eeb0c8.tar.gz
openrc-9ebd5a6aff73d70717f1d9a2f57767eae3eeb0c8.tar.bz2
openrc-9ebd5a6aff73d70717f1d9a2f57767eae3eeb0c8.tar.xz
Add support for DragonFly BSD
Diffstat (limited to 'src')
-rw-r--r--src/librc/librc-daemon.c12
-rw-r--r--src/rc/rc-plugin.h2
-rw-r--r--src/rc/start-stop-daemon.c2
3 files changed, 12 insertions, 4 deletions
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 982da35..6e7d57f 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -164,9 +164,15 @@ librc_hidden_def(rc_find_pids)
# endif
# define _KINFO_PROC kinfo_proc
# define _KVM_GETARGV kvm_getargv
-# define _GET_KINFO_UID(kp) (kp.ki_ruid)
-# define _GET_KINFO_COMM(kp) (kp.ki_comm)
-# define _GET_KINFO_PID(kp) (kp.ki_pid)
+# if defined(__DragonFly__)
+# define _GET_KINFO_UID(kp) (kp.kp_ruid)
+# define _GET_KINFO_COMM(kp) (kp.kp_comm)
+# define _GET_KINFO_PID(kp) (kp.kp_pid)
+# else
+# define _GET_KINFO_UID(kp) (kp.ki_ruid)
+# define _GET_KINFO_COMM(kp) (kp.ki_comm)
+# define _GET_KINFO_PID(kp) (kp.ki_pid)
+# endif
# define _KVM_PATH _PATH_DEVNULL
# define _KVM_FLAGS O_RDONLY
# endif
diff --git a/src/rc/rc-plugin.h b/src/rc/rc-plugin.h
index f763c3e..b4e40ab 100644
--- a/src/rc/rc-plugin.h
+++ b/src/rc/rc-plugin.h
@@ -41,7 +41,7 @@ void rc_plugin_unload(void);
void rc_plugin_run(RC_HOOK, const char *value);
/* dlfunc defines needed to avoid ISO errors. FreeBSD has this right :) */
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
struct __dlfunc_arg {
int __dlfunc_dummy;
};
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index bfa8852..5576d49 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -110,6 +110,7 @@ extern char **environ;
#if !defined(SYS_ioprio_set) && defined(__NR_ioprio_set)
# define SYS_ioprio_set __NR_ioprio_set
#endif
+#if !defined(__DragonFly__)
static inline int ioprio_set(int which, int who, int ioprio)
{
#ifdef SYS_ioprio_set
@@ -118,6 +119,7 @@ static inline int ioprio_set(int which, int who, int ioprio)
return 0;
#endif
}
+#endif
static void
free_schedulelist(void)