added comment on float cookie
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 17 Jul 2007 21:46:00 +0000 (21:46 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 17 Jul 2007 21:46:00 +0000 (21:46 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1155 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_open.c
src/rrd_resize.c

index 4b9a0f9..a01b075 100644 (file)
@@ -90,6 +90,8 @@ rrd_file_t *rrd_open(
     off_t     newfile_size = 0;
 
     if (rdwr & RRD_CREAT) {
     off_t     newfile_size = 0;
 
     if (rdwr & RRD_CREAT) {
+        /* yes bad inline signaling alert, we are using the
+           floatcookie to pass the size in ... only used in resize */
         newfile_size = (off_t) rrd->stat_head->float_cookie;
         free(rrd->stat_head);
     }
         newfile_size = (off_t) rrd->stat_head->float_cookie;
         free(rrd->stat_head);
     }
index 9dcfcca..c45ec14 100644 (file)
@@ -82,6 +82,7 @@ int rrd_resize(
             return (-1);
         }
     /* the size of the new file */
             return (-1);
         }
     /* the size of the new file */
+    /* yes we are abusing the float cookie for this, aargh */
     if ((rrdnew.stat_head = calloc(1, sizeof(stat_head_t))) == NULL) {
         rrd_set_error("allocating stat_head for new RRD");
         rrd_free(&rrdold);
     if ((rrdnew.stat_head = calloc(1, sizeof(stat_head_t))) == NULL) {
         rrd_set_error("allocating stat_head for new RRD");
         rrd_free(&rrdold);