🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #10132

stdarg.h

#10132
From: Jesús Carrete Montaña
Date: Wed, 27 Mar 2002 19:09
42 lines
2234 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Buenas.

        Estoy intentando hacer una funci�n de invocaci�n an�loga a la
de printf() para escribir por una pipe. El c�digo es el siguiente:

void ircpipe_write(char *format,...)
{
   va_list args;
   FILE *file_temp;

   file_temp=fdopen(descriptors[1],"w");
   va_start(args, format);
   vfprintf(file_temp,format,args);
   fclose(file_temp);
   va_end(args);
   // Esperar por SIGUSR2.
   pause();
   // Retardo adicional.
   sleep(2);
}

        Tal como est� me produce un segfault, y no soy capaz de
encontrarlo. Por otra parte si quito esta forma de invocaci�n ti tiro
de asprintf antes de llamar a la funci�n no pasa anda, as� que s� con
seguridad (a menos que est� muy equivocado) que es culpa de va_*
. �Alguien podr�a echarme una mano?

Un saludo.
- -- 
I am Computer of Borg. Login is futile. Your access will be denied.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.6 <http://mailcrypt.sourceforge.net/>

iD8DBQE8ohkDfUtQQKOnZ1IRAk62AKDP3uWO0RDNkfndw5YJ0EWM50dTkQCg5Nmk
vaZAncW8GFliTalfd5KhvNw=
=FipA
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <87d6xpket6.fsf@meltdown.ion>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!213-98-107-123.uc.nombres.ttd.ES!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,f5da4abf70825f48,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-03-27 11:35:09 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!213-98-107-123.uc.nombres.ttd.ES!not-for-mail
From: kuantiko@escomposlinux.org (Jesús Carrete
  Montaña)
Newsgroups: es.comp.os.linux.programacion
Subject: stdarg.h
Date: 27 Mar 2002 20:09:57 +0100
Organization: ecolnet
Lines: 42
Sender: kuantiko@meltdown.ion
Message-ID: <87d6xpket6.fsf@meltdown.ion>
NNTP-Posting-Host: 213-98-107-123.uc.nombres.ttd.es (213.98.107.123)
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 1017257707 25212726 213.98.107.123 (16 [64988])
X-Orig-Path: antonio.escomposlinux.org!relativistic.homeip.net!nobody
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7