From e1b4a377222c53a186de6dabca5cb0068a1c7738 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 13 May 2009 22:26:11 +0000 Subject: [PATCH] Bye-bye nonworking IRIX, can be rescued from the attic if ever needed again. --- GNUmakefile | 13 +------ compat/forkpty-irix.c | 83 ------------------------------------------- 2 files changed, 1 insertion(+), 95 deletions(-) delete mode 100644 compat/forkpty-irix.c diff --git a/GNUmakefile b/GNUmakefile index 3155aa1c..7e7d7826 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,4 @@ -# $Id: GNUmakefile,v 1.93 2009-05-13 22:20:47 nicm Exp $ +# $Id: GNUmakefile,v 1.94 2009-05-13 22:26:11 nicm Exp $ .PHONY: clean @@ -76,17 +76,6 @@ CFLAGS+= -DNO_TREE_H -DNO_ASPRINTF -DNO_QUEUE_H -DNO_VSYSLOG \ LDFLAGS+= -L/usr/local/lib endif -ifeq ($(shell uname),IRIX64) -INCDIRS+= -Icompat -I/usr/local/include/ncurses -SRCS+= compat/strlcpy.c compat/strtonum.c compat/daemon.c \ - compat/asprintf.c compat/fgetln.c compat/forkpty-irix.c -CFLAGS+= -DNO_STRLCPY -DNO_STRTONUM -DNO_TREE_H -DNO_SETPROCTITLE \ - -DNO_DAEMON -DNO_FORKPTY -DNO_PROGNAME -DNO_ASPRINTF -DNO_FGETLN \ - -DBROKEN_VSNPRINTF -D_SGI_SOURCE -std=c99 -LDFLAGS+= -L/usr/local/lib -LIBS+= -lgen -endif - ifeq ($(shell uname),SunOS) INCDIRS+= -Icompat -I/usr/include/ncurses SRCS+= compat/strtonum.c compat/daemon.c compat/forkpty-sunos.c \ diff --git a/compat/forkpty-irix.c b/compat/forkpty-irix.c deleted file mode 100644 index c7809b68..00000000 --- a/compat/forkpty-irix.c +++ /dev/null @@ -1,83 +0,0 @@ -/* $Id: forkpty-irix.c,v 1.2 2008-09-26 06:45:28 nicm Exp $ */ - -/* - * Copyright (c) 2008 Nicholas Marriott - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include -#include - -#include -#include -#include -#include - -#include "tmux.h" - -pid_t -forkpty(int *master, - unused char *name, unused struct termios *tio, struct winsize *ws) -{ - int slave, fd; - char *path; - pid_t pid; - void *old; - - path = _getpty(master, O_RDWR, 0622, 0); - if (path == NULL) - goto out; - - if ((slave = open(path, O_RDWR|O_NOCTTY)) == -1) - goto out; - - switch (pid = fork()) { - case -1: - goto out; - case 0: - close(*master); - - setsid(); - - old = signal(SIGHUP, SIG_IGN); - vhangup(); - signal(SIGHUP, old); - - if ((fd = open(path, O_RDWR)) == -1) - fatal("open failed"); - close(slave); - slave = fd; - - if (ioctl(slave, TIOCSWINSZ, ws) == -1) - fatal("ioctl failed"); - - dup2(slave, 0); - dup2(slave, 1); - dup2(slave, 2); - if (slave > 2) - close(slave); - return (0); - } - - close(slave); - return (pid); - -out: - if (*master != -1) - close(*master); - if (slave != -1) - close(slave); - return (-1); -}