From 759c4f7b797dd86d6ac4b1e34601f390371ad651 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 17 Mar 2010 17:27:28 +0100 Subject: Don't connect PTY slave's stderr to master stderr Doing so causes DirAx to behave REALLY weirdly. --- src/dirax.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/dirax.c b/src/dirax.c index 06018fb7..9cb4f66c 100644 --- a/src/dirax.c +++ b/src/dirax.c @@ -350,11 +350,9 @@ static int dirax_readable(struct image *image) void run_dirax(struct image *image) { unsigned int opts; - int saved_stderr; int status; int rval; - saved_stderr = dup(STDERR_FILENO); image->dirax_pid = forkpty(&image->dirax_pty, NULL, NULL, NULL); if ( image->dirax_pid == -1 ) { ERROR("Failed to fork for DirAx\n"); @@ -370,9 +368,6 @@ void run_dirax(struct image *image) t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL); tcsetattr(STDIN_FILENO, TCSANOW, &t); - /* Reconnect stderr */ - dup2(saved_stderr, STDERR_FILENO); - execlp("dirax", "", (char *)NULL); ERROR("Failed to invoke DirAx.\n"); _exit(0); @@ -419,7 +414,6 @@ void run_dirax(struct image *image) } while ( !rval ); close(image->dirax_pty); - close(saved_stderr); free(image->dirax_rbuffer); wait(&status); -- cgit v1.2.3