X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=osl.c;h=67160d2b3bb14539edf1cd5f8b886d55940d0f63;hp=90601dc287e3b8ec3de7baf7b9d1c6f2862e1c72;hb=ea49cbcde26d2a57b9564dbc0067ec640fd0d1ed;hpb=62d228ecaf10d6bd6a1e592bf9d180d36b0f036e diff --git a/osl.c b/osl.c index 90601dc..67160d2 100644 --- a/osl.c +++ b/osl.c @@ -61,20 +61,18 @@ static void __attribute ((constructor)) init_loglevel(void) __printf_2_3 void __log(int ll, const char* fmt,...) { va_list argp; - FILE *outfd; struct tm *tm; time_t t1; char str[255] = ""; if (ll < loglevel) return; - outfd = stderr; time(&t1); tm = localtime(&t1); strftime(str, sizeof(str), "%b %d %H:%M:%S", tm); - fprintf(outfd, "%s ", str); + fprintf(stderr, "%s ", str); va_start(argp, fmt); - vfprintf(outfd, fmt, argp); + vfprintf(stderr, fmt, argp); va_end(argp); } @@ -1047,6 +1045,7 @@ int init_rbtrees(struct osl_table *t) /* add valid rows to rbtrees */ t->num_invalid_rows = 0; for (i = 0; i < t->num_rows; i++) { + struct osl_object *volatile_objs; ret = row_is_invalid(t, i); if (ret < 0) return ret; @@ -1054,7 +1053,14 @@ int init_rbtrees(struct osl_table *t) t->num_invalid_rows++; continue; } - ret = add_row_to_rbtrees(t, i, NULL, NULL); + if (t->num_volatile_columns > 0) { + volatile_objs = calloc(t->num_volatile_columns, + sizeof(struct osl_object)); + if (!volatile_objs) + return -E_OSL_NOMEM; + } else + volatile_objs = NULL; + ret = add_row_to_rbtrees(t, i, volatile_objs, NULL); if (ret < 0) return ret; }