mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 12:37:02 +00:00
Use MAC_OS_X_VERSION_MIN_REQUIRED. From Sevan Janiyan, GitHub issue 4550.
This commit is contained in:
@ -49,12 +49,12 @@
|
||||
|
||||
#include <mach/mach.h>
|
||||
|
||||
#include <Availability.h>
|
||||
#include <AvailabilityMacros.h>
|
||||
#include <unistd.h>
|
||||
|
||||
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 *);
|
||||
|
@ -16,11 +16,14 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <Availability.h>
|
||||
#include <AvailabilityMacros.h>
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
#include <libproc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user