freebsd-ports/shells/viewglob/files/patch-src::ptutil.viewglob.c
Edwin Groothuis 1f936c50cb New port: shells/viewglob, a GTK+ add-on to bash and zsh
viewglob is an utility designed to complement the Unix shell
	in graphical environments. It has two parts:

	  1. A tool that sits as a layer between the shell and X
	     terminal, keeping track of the user's current directory
	     and command line.

	  2. A graphical display which shows the layouts of directories
	     referenced on the command line (including pwd).

	The display reveals the results of file globs and expansions
	as they are typed (hence the name), highlighting selected
	files and potential name completions.

	It can also be used as a surrogate terminal, where keystrokes
	typed in the display are passed to the shell. Files and
	directories can be double-clicked to insert their names
	and/or paths into the terminal.

PR:		ports/72369
Submitted by:	Jean-Yves Lefort <jylefort@brutele.be>
2004-10-14 07:38:35 +00:00

27 lines
811 B
C

--- src/ptutil.viewglob.c.orig Wed Oct 6 03:34:54 2004
+++ src/ptutil.viewglob.c Wed Oct 6 03:47:51 2004
@@ -45,7 +45,6 @@
#endif
/*[incl]*/
#ifdef _XOPEN_UNIX
-#include <stropts.h> /* for STREAMS */
#endif
#ifdef NEED_TIOCSCTTY
#include <sys/ttycom.h> /* for TIOCSCTTY */
@@ -73,14 +72,9 @@
static bool find_and_open_master(PTINFO *p)
{
#if defined(_XOPEN_UNIX)
-#if _XOPEN_VERSION >= 600
p->pt_name_m[0] = '\0'; /* don't know or need name */
- ec_neg1( p->pt_fd_m = posix_openpt(O_RDWR | O_NOCTTY) )
-#else
- strcpy(p->pt_name_m, "/dev/ptmx"); /* clone device */
- if ( (p->pt_fd_m = open(p->pt_name_m, O_RDWR)) == -1)
- goto failure;
-#endif
+ if ((p->pt_fd_m = posix_openpt(O_RDWR | O_NOCTTY)) == -1)
+ return false;
#elif defined(MASTER_NAME_SEARCH)
int i, j;
char proto[] = PTY_PROTO;