[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rrd-users
Subject:    [rrd-users] fd leak patch
From:       oetiker () ee ! ethz ! ch (Tobias Oetiker)
Date:       2000-04-18 21:06:16
Message-ID: Pine.GSO.4.21.0004182303500.12369-100000 () drwho ! ee ! ethz ! ch
[Download RAW message or body]

Folks,

there is a fd leak in connection with lazy mode:

--- rrd_graph.c~        Sun Apr 16 22:36:21 2000
+++ rrd_graph.c Tue Apr 18 23:00:54 2000
@@ -2277,6 +2277,7 @@
 
 int lazy_check(image_desc_t *im){
     FILE *fd = NULL;
+    int size = 1;
     struct stat  gifstat;
     
     if (im->lazy == 0) return 0; /* no lazy option */
@@ -2291,12 +2292,12 @@
       return 0; /* the file does not exist */
     switch (im->imgformat) {
     case IF_GIF:
-       return GifSize(fd,&(im->xgif),&(im->ygif));
+       size = GifSize(fd,&(im->xgif),&(im->ygif));
     case IF_PNG:
-       return PngSize(fd,&(im->xgif),&(im->ygif));
+       size = PngSize(fd,&(im->xgif),&(im->ygif));
     }
     fclose(fd);
-    return 1;
+    return size;
 }
 
fixes it ...

cheers
tobi

PS: Thanks to Edouard Lagache and Wim Holemans for helping with this one 

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker, Timelord & SysMgr @ EE-Dept ETH-Zurich
 / // _ \/ _ \/ / TEL: +41(0)1-6325286  FAX:...1517  ICQ: 10419518 
/_/ \.__/_.__/_/ oetiker at ee.ethz.ch http://ee-staff.ethz.ch/~oetiker



--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic