fix spaceing ... more space for the title and more space the the left of the yaxis...
[rrdtool.git] / src / rrd_create.c
index 6573fc5..95dbc14 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.1.x  Copyright Tobias Oetiker, 1997 - 2002
+ * RRDtool 1.2.0  Copyright by Tobi Oetiker, 1997-2005
  *****************************************************************************
  * rrd_create.c  creates new rrds
  *****************************************************************************/
@@ -23,6 +23,7 @@ rrd_create(int argc, char **argv)
     char *parsetime_error = NULL;
     long              long_tmp;
     int               rc;
+    optind = 0; opterr = 0;  /* initialize getopt */
 
     while (1){
        static struct option long_options[] =
@@ -103,12 +104,14 @@ rrd_create_r(char *filename,
     /* static header */
     if((rrd.stat_head = calloc(1,sizeof(stat_head_t)))==NULL){
        rrd_set_error("allocating rrd.stat_head");
+       rrd_free(&rrd);
        return(-1);
     }
 
     /* live header */
     if((rrd.live_head = calloc(1,sizeof(live_head_t)))==NULL){
        rrd_set_error("allocating rrd.live_head");
+       rrd_free(&rrd);
        return(-1);
     }
 
@@ -388,6 +391,7 @@ rrd_create_r(char *filename,
                 fprintf(stderr,"Creating HW contingent RRAs\n");
 #endif
                 if (create_hw_contingent_rras(&rrd,period,hashed_name) == -1) {
+                    rrd_set_error("creating contingent RRA");
                     rrd_free(&rrd);
                     return -1;
                 }