Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 21 Feb 2003 17:39:59 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: to use dup() in cygwin Message-ID: <20030221163959.GS1403@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i On Fri, Feb 21, 2003 at 10:01:17AM +0100, Fernando DOT Frutos DOT Martin AT es DOT jazztel DOT com wrote: > Hi! and sorry my english, > I've a server in Linux and Unix and it works perfectly, but when I compile > the same code in Cygwin, it doesn`t send the data to the socket, I use the > dup() comand. > this is part of the program what, I repeat, works well in linux and unix > (sun, HP) > > /*close the display exit and send it to the socket*/ > > close(1); > iError=dup(iDescSock); > if (iError==-1) > { > return(EEXECCOM); > } > sprintf(pcComando,"EjecutarComando_VB.ksh.%s",pcNombreAux); > iError=system(pcComando); > if (iError==-1) > { > fprintf(stderr,"Error en llamada a ejecutar"); > return(EEXECCOM); > } Did you try to - look if you get the expected file descriptor from dup? - look which errno you get? - run the application under strace? - run the application under gdb? After that and if you found that the problem is actually a Cygwin problem, please write a *short* testcase which allows to reproduce the problem and I';ll be happy to have a look into this issue. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/