From: Andre Noll Date: Sun, 5 Apr 2015 13:35:13 +0000 (+0000) Subject: com_check(): Return negative on errors X-Git-Tag: v0.5.6~94^2~20 X-Git-Url: http://git.tuebingen.mpg.de/?a=commitdiff_plain;ds=sidebyside;h=b605df7dcee2c6e642a141aea24e643eb6ca34ec;p=paraslash.git com_check(): Return negative on errors --- diff --git a/aft.c b/aft.c index c255b245..0207705f 100644 --- a/aft.c +++ b/aft.c @@ -2506,7 +2506,7 @@ int send_afs_status(struct command_context *cc, int parser_friendly) afs_cb_result_handler, cc); } -/* returns success even on errors to keep the loop going */ +/* returns success on non-fatal errors to keep the loop going */ static int check_audio_file(struct osl_row *row, void *data) { char *path; @@ -2518,7 +2518,7 @@ static int check_audio_file(struct osl_row *row, void *data) if (ret < 0) { para_printf(pb, "%s\n", para_strerror(-ret)); - return 0; + return ret; } if (stat(path, &statbuf) < 0) para_printf(pb, "%s: stat error (%s)\n", path, strerror(errno)); @@ -2546,12 +2546,13 @@ static int check_audio_file(struct osl_row *row, void *data) * \param fd The afs socket. * \param query Unused. * - * \return This function always returns zero. + * \return Standard. Inconsistencies are reported but not regarded as an error. * * \sa com_check(). */ int aft_check_callback(int fd, __a_unused const struct osl_object *query) { + int ret; struct para_buffer pb = { .max_size = shm_get_shmmax(), .private_data = &(struct afs_max_size_handler_data) { @@ -2561,9 +2562,9 @@ int aft_check_callback(int fd, __a_unused const struct osl_object *query) .max_size_handler = afs_max_size_handler }; para_printf(&pb, "checking audio file table...\n"); - audio_file_loop(&pb, check_audio_file); + ret = audio_file_loop(&pb, check_audio_file); flush_and_free_pb(&pb); - return 0; + return ret; } /**