X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mood.c;h=a98f68b2e44c997843148a0400d84d3ba02710be;hp=cbb2f438ef7d41ce22f33d6c4c927cc1227d9963;hb=112efddb6753266296cad0a9b0499528fe784214;hpb=2edd5e54e7443ed42d4c4e56c2efb242956f818b diff --git a/mood.c b/mood.c index cbb2f438..a98f68b2 100644 --- a/mood.c +++ b/mood.c @@ -432,8 +432,10 @@ out: * * \param fd The afs socket. * \param query Unused. + * + * \return Currently this function always returns zero. */ -void mood_check_callback(int fd, __a_unused const struct osl_object *query) +int mood_check_callback(int fd, __a_unused const struct osl_object *query) { struct para_buffer pb = { .max_size = shm_get_shmmax(), @@ -447,9 +449,8 @@ void mood_check_callback(int fd, __a_unused const struct osl_object *query) para_printf(&pb, "checking moods...\n"); osl_rbtree_loop(moods_table, BLOBCOL_ID, &pb, check_mood); - if (pb.offset) - pass_buffer_as_shm(fd, SBD_OUTPUT, pb.buf, pb.offset); - free(pb.buf); + flush_and_free_pb(&pb); + return 0; } static int64_t normalized_value(int64_t x, int64_t n, int64_t sum, int64_t qd)