$NetBSD: patch-ar,v 1.1 2007/09/19 22:22:40 wiz Exp $ --- libgnomevfs/gnome-vfs-pty.c.orig Tue Nov 22 15:10:17 2005 +++ libgnomevfs/gnome-vfs-pty.c Wed Apr 26 23:15:08 2006 @@ -306,7 +306,7 @@ _gnome_vfs_pty_run_on_pty(int fd, gboole chdir(directory); } -#ifdef HAVE_UTMP_H +#ifdef HAVE_LOGIN_TTY /* This sets stdin, stdout, stderr to the socket */ if (login && login_tty (fd) == -1) { g_printerr ("mount child process login_tty failed: %s\n", strerror (errno)); @@ -629,6 +629,7 @@ _gnome_vfs_pty_set_size(int master, int static char * _gnome_vfs_pty_ptsname(int master) { +#ifndef __APPLE__ #if defined(HAVE_PTSNAME_R) gsize len = 1024; char *buf = NULL; @@ -674,6 +675,7 @@ _gnome_vfs_pty_ptsname(int master) return g_strdup_printf("/dev/pts/%d", pty); } #endif +#endif /* __APPLE__ */ return NULL; } @@ -681,10 +683,10 @@ static int _gnome_vfs_pty_getpt(void) { int fd, flags; -#ifdef HAVE_GETPT +#if defined(HAVE_GETPT) && !defined(__APPLE__) /* Call the system's function for allocating a pty. */ fd = getpt(); -#elif defined(HAVE_POSIX_OPENPT) +#elif defined(HAVE_POSIX_OPENPT) && !defined(__APPLE__) fd = posix_openpt(O_RDWR | O_NOCTTY); #else /* Try to allocate a pty by accessing the pty master multiplex. */ @@ -703,7 +705,7 @@ _gnome_vfs_pty_getpt(void) static int _gnome_vfs_pty_grantpt(int master) { -#ifdef HAVE_GRANTPT +#if defined(HAVE_GRANTPT) && !defined(__APPLE__) return grantpt(master); #else return 0; @@ -713,6 +715,9 @@ _gnome_vfs_pty_grantpt(int master) static int _gnome_vfs_pty_unlockpt(int fd) { +#ifdef __APPLE__ + return -1; +#else #ifdef HAVE_UNLOCKPT return unlockpt(fd); #elif defined(TIOCSPTLCK) @@ -720,6 +725,7 @@ _gnome_vfs_pty_unlockpt(int fd) return ioctl(fd, TIOCSPTLCK, &zero); #else return -1; +#endif #endif }