From: Marco van Wieringen Date: Wed, 7 Apr 2010 14:31:58 +0000 (+0200) Subject: Make the batch insert functions return bool instead of int. X-Git-Tag: Release-5.0.2~87 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=58a085a309bfe9982b9a3bca71d3051aa79d180f;p=bacula%2Fbacula Make the batch insert functions return bool instead of int. --- diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index 688bff4935..96982be16c 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -601,10 +601,10 @@ INGRES_FIELD * my_ingres_fetch_field(B_DB *mdb); void my_ingres_close (B_DB *mdb); int my_ingres_insert_id (B_DB *mdb, const char *query, const char *table_name); -int my_ingres_batch_start(JCR *jcr, B_DB *mdb); -int my_ingres_batch_end(JCR *jcr, B_DB *mdb, const char *error); +bool my_ingres_batch_start(JCR *jcr, B_DB *mdb); +bool my_ingres_batch_end(JCR *jcr, B_DB *mdb, const char *error); typedef struct ATTR_DBR ATTR_DBR; -int my_ingres_batch_insert(JCR *jcr, B_DB *mdb, ATTR_DBR *ar); +bool my_ingres_batch_insert(JCR *jcr, B_DB *mdb, ATTR_DBR *ar); char *my_ingres_copy_escape(char *dest, char *src, size_t len); extern const char* my_ingres_batch_lock_path_query; diff --git a/bacula/src/cats/ingres.c b/bacula/src/cats/ingres.c index b44a3f683e..b966840a74 100755 --- a/bacula/src/cats/ingres.c +++ b/bacula/src/cats/ingres.c @@ -728,7 +728,12 @@ bail_out: } #ifdef HAVE_BATCH_FILE_INSERT -int my_ingres_batch_start(JCR *jcr, B_DB *mdb) + +/* + * Returns true if OK + * false if failed + */ +bool my_ingres_batch_start(JCR *jcr, B_DB *mdb) { bool ok; @@ -746,7 +751,11 @@ int my_ingres_batch_start(JCR *jcr, B_DB *mdb) return ok; } -int my_ingres_batch_end(JCR *jcr, B_DB *mdb, const char *error) +/* + * Returns true if OK + * false if failed + */ +bool my_ingres_batch_end(JCR *jcr, B_DB *mdb, const char *error) { if (mdb) { mdb->status = 0; @@ -754,7 +763,11 @@ int my_ingres_batch_end(JCR *jcr, B_DB *mdb, const char *error) return true; } -int my_ingres_batch_insert(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) +/* + * Returns true if OK + * false if failed + */ +bool my_ingres_batch_insert(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) { size_t len; const char *digest; @@ -778,6 +791,7 @@ int my_ingres_batch_insert(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) return INSERT_DB(jcr, mdb, mdb->cmd); } + #endif /* HAVE_BATCH_FILE_INSERT */ /*