diff --git a/compat/daemon-darwin.c b/compat/daemon-darwin.c index 64400206..18f276af 100644 --- a/compat/daemon-darwin.c +++ b/compat/daemon-darwin.c @@ -49,12 +49,12 @@ #include -#include +#include #include void daemon_darwin(void); -#ifdef __MAC_10_10 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 extern kern_return_t bootstrap_look_up_per_user(mach_port_t, const char *, uid_t, mach_port_t *); diff --git a/osdep-darwin.c b/osdep-darwin.c index a2b125ad..79090d9f 100644 --- a/osdep-darwin.c +++ b/osdep-darwin.c @@ -16,11 +16,14 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include #include -#include +#include +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 #include +#endif #include #include #include @@ -31,14 +34,10 @@ char *osdep_get_name(int, char *); char *osdep_get_cwd(int); struct event_base *osdep_event_init(void); -#ifndef __unused -#define __unused __attribute__ ((__unused__)) -#endif - char * osdep_get_name(int fd, __unused char *tty) { -#ifdef __MAC_10_7 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 struct proc_bsdshortinfo bsdinfo; pid_t pgrp; int ret; @@ -72,6 +71,7 @@ osdep_get_name(int fd, __unused char *tty) char * osdep_get_cwd(int fd) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 static char wd[PATH_MAX]; struct proc_vnodepathinfo pathinfo; pid_t pgrp; @@ -86,6 +86,7 @@ osdep_get_cwd(int fd) strlcpy(wd, pathinfo.pvi_cdir.vip_path, sizeof wd); return (wd); } +#endif return (NULL); }