fixed pango markup switch ... we still want the text to show even if no markup is...
[rrdtool.git] / src / rrd_create.c
index 027c6ab..42f3ed3 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.2.99907080300  Copyright by Tobi Oetiker, 1997-2007
+ * RRDtool 1.3rc8  Copyright by Tobi Oetiker, 1997-2008
  *****************************************************************************
  * rrd_create.c  creates new rrds
  *****************************************************************************/
@@ -40,7 +40,7 @@ int rrd_create(
     int       opt;
     time_t    last_up = time(NULL) - 10;
     unsigned long pdp_step = 300;
-    struct rrd_time_value last_up_tv;
+    rrd_time_value_t last_up_tv;
     char     *parsetime_error = NULL;
     long      long_tmp;
     int       rc;
@@ -56,7 +56,7 @@ int rrd_create(
 
         switch (opt) {
         case 'b':
-            if ((parsetime_error = parsetime(optarg, &last_up_tv))) {
+            if ((parsetime_error = rrd_parsetime(optarg, &last_up_tv))) {
                 rrd_set_error("start time: %s", parsetime_error);
                 return (-1);
             }
@@ -694,13 +694,13 @@ int rrd_create_fn(
 
     if ((rrd->pdp_prep = calloc(1, sizeof(pdp_prep_t))) == NULL) {
         rrd_set_error("allocating pdp_prep");
-        free(rrd->stat_head);       
-        free(rrd->live_head);       
+        free(rrd->stat_head);
+        free(rrd->live_head);
         close(rrd_file);
         return (-1);
     }
 
-    strcpy(rrd->pdp_prep->last_ds, "UNKN");
+    strcpy(rrd->pdp_prep->last_ds, "U");
 
     rrd->pdp_prep->scratch[PDP_val].u_val = 0.0;
     rrd->pdp_prep->scratch[PDP_unkn_sec_cnt].u_cnt =
@@ -711,8 +711,8 @@ int rrd_create_fn(
 
     if ((rrd->cdp_prep = calloc(1, sizeof(cdp_prep_t))) == NULL) {
         rrd_set_error("allocating cdp_prep");
-        free(rrd->stat_head);       
-        free(rrd->live_head);       
+        free(rrd->stat_head);
+        free(rrd->live_head);
         close(rrd_file);
         return (-1);
     }
@@ -759,8 +759,8 @@ int rrd_create_fn(
 
     if ((rrd->rra_ptr = calloc(1, sizeof(rra_ptr_t))) == NULL) {
         rrd_set_error("allocating rra_ptr");
-        free(rrd->stat_head);       
-        free(rrd->live_head);       
+        free(rrd->stat_head);
+        free(rrd->live_head);
         close(rrd_file);
         return (-1);
     }
@@ -777,8 +777,8 @@ int rrd_create_fn(
     /* write the empty data area */
     if ((unknown = (rrd_value_t *) malloc(512 * sizeof(rrd_value_t))) == NULL) {
         rrd_set_error("allocating unknown");
-        free(rrd->stat_head);       
-        free(rrd->live_head);       
+        free(rrd->stat_head);
+        free(rrd->live_head);
         close(rrd_file);
         return (-1);
     }
@@ -796,8 +796,8 @@ int rrd_create_fn(
     }
     free(unknown);
     fdatasync(rrd_file);
-    free(rrd->stat_head);       
-    free(rrd->live_head);       
+    free(rrd->stat_head);
+    free(rrd->live_head);
     if (close(rrd_file) == -1) {
         rrd_set_error("creating rrd: %s", rrd_strerror(errno));
         return -1;
@@ -812,14 +812,13 @@ int rrd_create_fn(
 
 static int rand_init = 0;
 
-long int
-rra_random_row(rra_def_t *rra)
+long int rra_random_row(
+    rra_def_t *rra)
 {
-    if (!rand_init)
-    {
-        srandom((unsigned int)time(NULL) + (unsigned int)getpid());
+    if (!rand_init) {
+        srandom((unsigned int) time(NULL) + (unsigned int) getpid());
         rand_init++;
     }
-    
+
     return random() % rra->row_cnt;
 }