delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/11/14/05:55:19

From: corinna DOT vinschen AT cityweb DOT de (Corinna Vinschen)
Subject: Re: B20 Problems...
14 Nov 1998 05:55:19 -0800 :
Message-ID: <364CE0FC.C3477954.cygnus.gnu-win32@cityweb.de>
References: <s64c4ce6 DOT 084 AT bkup DOT mcdata DOT com>
Mime-Version: 1.0
To: Raj Menon <rxmtemp AT mcdata DOT com>, gnu-win32 AT cygnus DOT com

Hello Raj,

I have figured out, that the libc function `dup()'
not in any case does what expected. Until I have found
the correct solution for this problem, I have a
patch, that solves nearly all problems by patching
tcsh for a while. Unfortunately, here scripts still doesn't
work, if tcsh is a subshell. But it's better than nothing.

Your make problem is less significant if CYGWIN=...notty...,
I have found, that configure scripts run completely in
notty mode, but hang very often in tty mode. I'm using
tty mode only with care.

Regards,
Corinna

---- snip ----
--- sh.sem.c.orig       Sat Nov 14 02:29:43 1998
+++ sh.sem.c    Sat Nov 14 02:22:05 1998
@@ -857,7 +857,8 @@ doio(t, pipein, pipeout)
        }
        else if (flags & F_PIPEIN) {
            (void) close(0);
-           (void) dup(pipein[0]);
+           //(void) dup(pipein[0]);
+           (void) dup2(pipein[0], 0);
            (void) close(pipein[0]);
            (void) close(pipein[1]);
        }
@@ -867,7 +868,8 @@ doio(t, pipein, pipeout)
        }
        else {
            (void) close(0);
-           (void) dup(OLDSTD);
+           //(void) dup(OLDSTD);
+           (void) dup2(OLDSTD, 0);
 #if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
            /*
             * PWP: Unlike Bezerkeley 4.3, FIONCLEX for Pyramid is preserved
@@ -919,12 +921,14 @@ doio(t, pipein, pipeout)
     }
     else if (flags & F_PIPEOUT) {
        (void) close(1);
-       (void) dup(pipeout[1]);
+       //(void) dup(pipeout[1]);
+       (void) dup2(pipeout[1], 1);
        is1atty = 0;
     }
     else {
        (void) close(1);
-       (void) dup(SHOUT);
+       //(void) dup(SHOUT);
+       (void) dup2(SHOUT, 1);
        is1atty = isoutatty;
 #if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
        (void) close_on_exec(1, 0);
@@ -933,11 +937,13 @@ doio(t, pipein, pipeout)

     (void) close(2);
     if (flags & F_STDERR) {
-       (void) dup(1);
+       //(void) dup(1);
+       (void) dup2(1, 2);
        is2atty = is1atty;
     }
     else {
-       (void) dup(SHDIAG);
+       //(void) dup(SHDIAG);
+       (void) dup2(SHDIAG, 2);
        is2atty = isdiagatty;
 #if defined(CLOSE_ON_EXEC) && defined(CLEX_DUPS)
        (void) close_on_exec(2, 0);
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019