mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Use MAC_OS_X_VERSION_MIN_REQUIRED. From Sevan Janiyan, GitHub issue 4550.
This commit is contained in:
		@@ -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