[rrd-developers] Re: BUG: attempt to put segment in horiz list twice ??

Per Jessen per at computer.org
Wed Jul 27 17:58:36 MEST 2005


Ruud H.G. van Tol wrote:

> OK, but then I don't understand how the stderr-data could get mixed with
> the PNG-data. Or did I understand that wrong?
> Does libart maybe send error messages to stdout too? 

when I use "rrdtool graph -", everything that is sent to stdout and stderr ends up on
stdout, and therefore ends up being part of the PNG (when I pipe it direct to a browser). 
Before I call system(), I redirect stdout to my http pipe.  Afterwards, when I tried to
divert stderr away (to make the PNG "clean"), the browser hangs as if the PNG hasn't
completely transferred.  

The code that occasionally produces bad PNGs: 

        oldstdout=dup(1);       // take a copy of stdout
        dup2(s,1);              // make stdout = s  (client http socket)

        system(buffer);         // call rrdtool to do the biz.

        dup2(oldstdout,1);      // restore stdout.

The code that produces good PNGs but make the browser hang:

        oldstdout=dup(1);       // take a copy of stdout
        oldstderr=dup(2);
        dup2(s,1);              // make stdout = s
        close(2);               // close stderr

        system(buffer);         // call rrdtool to do the biz.

        dup2(oldstdout,1);      // restore stdout.
        dup2(oldstderr,2);


> In a system() call, you can append " 2>$tmpfile" to the commandline.

Yeah, I did think of that too - I'll have to try it again, but I think it produced the
same result (browser hangs).


/Per Jessen, Zürich

-- 
http://www.spamchek.com/freetrial - managed anti-spam and anti-virus solution.
Sign up for your free 30-day trial now!


--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-developers
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-developers mailing list