From: Andre Noll Date: Sat, 11 Jul 2009 19:01:40 +0000 (+0200) Subject: Merge branch 'master' into next X-Git-Tag: v0.4.0~51^2~2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=92339599bddb1b1b79b6aa76d645b403081f4835;hp=ed7b668ad79fdcde7bc8abddd46f721d5b232d04 Merge branch 'master' into next --- diff --git a/afs.c b/afs.c index 531cada8..1350db34 100644 --- a/afs.c +++ b/afs.c @@ -60,13 +60,13 @@ enum afs_table_num { }; static struct afs_table afs_tables[NUM_AFS_TABLES] = { - [TBLNUM_AUDIO_FILES] = {.init = aft_init}, - [TBLNUM_ATTRIBUTES] = {.init = attribute_init}, - [TBLNUM_SCORES] = {.init = score_init}, - [TBLNUM_MOODS] = {.init = moods_init}, - [TBLNUM_LYRICS] = {.init = lyrics_init}, - [TBLNUM_IMAGES] = {.init = images_init}, - [TBLNUM_PLAYLIST] = {.init = playlists_init}, + [TBLNUM_AUDIO_FILES] = {.init = aft_init, .name = "audio_files"}, + [TBLNUM_ATTRIBUTES] = {.init = attribute_init, .name = "attributes"}, + [TBLNUM_SCORES] = {.init = score_init, .name = "scores"}, + [TBLNUM_MOODS] = {.init = moods_init, .name = "moods"}, + [TBLNUM_LYRICS] = {.init = lyrics_init, .name = "lyrics"}, + [TBLNUM_IMAGES] = {.init = images_init, .name = "images"}, + [TBLNUM_PLAYLIST] = {.init = playlists_init, .name = "playlists"}, }; struct command_task { @@ -1003,7 +1003,7 @@ static void create_tables_callback(int fd, const struct osl_object *query) { uint32_t table_mask = *(uint32_t *)query->data; int i, ret; - char *buf; + struct para_buffer pb = {.buf = NULL}; close_afs_tables(); for (i = 0; i < NUM_AFS_TABLES; i++) { @@ -1016,15 +1016,15 @@ static void create_tables_callback(int fd, const struct osl_object *query) ret = t->create(database_dir); if (ret < 0) goto out; + para_printf(&pb, "successfully created %s table\n", t->name); } ret = open_afs_tables(); out: - if (ret >= 0) - buf = make_message("successfully created afs table(s)\n"); - else - buf = make_message("%s\n", para_strerror(-ret)); - pass_buffer_as_shm(buf, strlen(buf), &fd); - free(buf); + if (ret < 0) + para_printf(&pb, "%s\n", para_strerror(-ret)); + if (pb.buf) + pass_buffer_as_shm(pb.buf, pb.offset, &fd); + free(pb.buf); } int com_init(struct rc4_context *rc4c, int argc, char * const * const argv) diff --git a/aft.c b/aft.c index 220e019e..a112abe7 100644 --- a/aft.c +++ b/aft.c @@ -2612,7 +2612,6 @@ static int aft_event_handler(enum afs_events event, struct para_buffer *pb, void aft_init(struct afs_table *t) { - t->name = audio_file_table_desc.name; t->open = aft_open; t->close = aft_close; t->create = aft_create; diff --git a/attribute.c b/attribute.c index b962661a..cfb7dde0 100644 --- a/attribute.c +++ b/attribute.c @@ -610,7 +610,6 @@ static int attribute_create(const char *dir) */ void attribute_init(struct afs_table *t) { - t->name = attribute_table_desc.name; t->open = attribute_open; t->close = attribute_close; t->create = attribute_create; diff --git a/blob.c b/blob.c index 6f10f0a2..126cab43 100644 --- a/blob.c +++ b/blob.c @@ -622,7 +622,6 @@ static int blob_open(struct osl_table **table, #define DEFINE_BLOB_INIT(table_name) \ void table_name ## _init(struct afs_table *t) \ { \ - t->name = table_name ## _table_desc.name; \ t->open = table_name ## _open; \ t->close = table_name ## _close; \ t->create = table_name ## _create;\