Wed May 25 17:10:43 PDT 2005
- Previous message: [Slony1-commit] By cbbrowne: Added a section to "Best Practices" with tips on handling
- Next message: [Slony1-commit] By cbbrowne: Changes from Neil Conway: This patch fixes various issues
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message: ----------- Changes from Neil Conway: This patch fixes various issues that crop up compiling with -Wall: - include parser/keywords.h in backend/slony1_funcs.c, to make the declaration of ScanKeywordLookup visible - make write_void_log() return void -- it's return value has never used, and in any case write_void_log() didn't actually return a value - include <sys/wait.h> in slon/slon.c, which is needed to make the declaration of wait(2) visible - add a missing return statement to slonik_repair_config() in slonik/slonik.c - initialize the return value of close_log_archive() properly in slon/remote_worker.c - remove some unused variable declarations - fix `elevel' in slon/configoptions.c:set_config_option() and get_config_option(). get_config_option() did not initialize `elevel', and set_config_option() initialized it incorrectly: find_option() takes a Postgres error level (e.g. WARNING), not a Slony error level (e.g. SLON_WARN). Modified Files: -------------- slony1-engine/src/slon: cleanup_thread.c (r1.25 -> r1.26) confoptions.c (r1.10 -> r1.11) remote_worker.c (r1.84 -> r1.85) slon.c (r1.51 -> r1.52) -------------- next part -------------- Index: confoptions.c =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/confoptions.c,v retrieving revision 1.10 retrieving revision 1.11 diff -Lsrc/slon/confoptions.c -Lsrc/slon/confoptions.c -u -w -r1.10 -r1.11 --- src/slon/confoptions.c +++ src/slon/confoptions.c @@ -376,12 +376,11 @@ get_config_option(const char *name) { struct config_generic *record; - int elevel; - record = find_option(name, elevel); + record = find_option(name, WARNING); if (record == NULL) { - slon_log(elevel, "unrecognized configuration parameter \"%s\"\n", name); + slon_log(SLON_WARN, "unrecognized configuration parameter \"%s\"\n", name); return NULL; } switch (record->vartype) @@ -422,15 +421,12 @@ set_config_option(const char *name, const char *value) { struct config_generic *record; - int elevel; - elevel = SLON_WARN; - - record = find_option(name, elevel); + record = find_option(name, WARNING); if (record == NULL) { - slon_log(elevel, "unrecognized configuration parameter \"%s\"\n", name); + slon_log(SLON_WARN, "unrecognized configuration parameter \"%s\"\n", name); return false; } switch (record->vartype) Index: remote_worker.c =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/remote_worker.c,v retrieving revision 1.84 retrieving revision 1.85 diff -Lsrc/slon/remote_worker.c -Lsrc/slon/remote_worker.c -u -w -r1.84 -r1.85 --- src/slon/remote_worker.c +++ src/slon/remote_worker.c @@ -251,7 +251,7 @@ static int submit_string_to_archive (const char *s); static int submit_raw_data_to_archive (const char *s); static int logarchive_tracking (const char *namespace, int sub_set, const char *firstseq, const char *seqbuf); -static int write_void_log (int node_id, char *seqbuf, const char *message); +static void write_void_log (int node_id, char *seqbuf, const char *message); #define TERMINATE_QUERY_AND_ARCHIVE dstring_free(&query); terminate_log_archive(); @@ -777,7 +777,6 @@ { int set_id = (int)strtol(event->ev_data1, NULL, 10); int add_id = (int)strtol(event->ev_data2, NULL, 10); - char dropquery[280]; rtcfg_dropSet(add_id); slon_appendquery(&query1, @@ -2414,11 +2413,7 @@ */ for (tupno1 = 0; tupno1 < ntuples1; tupno1++) { - int tab_id = strtol(PQgetvalue(res1, tupno1, 0), NULL, 10); char *tab_fqname = PQgetvalue(res1, tupno1, 1); - char *tab_idxname = PQgetvalue(res1, tupno1, 2); - char *tab_comment = PQgetvalue(res1, tupno1, 3); - int64 copysize = 0; gettimeofday(&tv_start2, NULL); slon_log(SLON_DEBUG2, "remoteWorkerThread_%d: " @@ -4711,7 +4706,7 @@ } int close_log_archive () { - int rc; + int rc = 0; if (archive_dir) { rc = fprintf(archive_fp, "\n------------------------------------------------------------------\n-- End Of Archive Log\n------------------------------------------------------------------\ncommit;\n"); rc = fclose(archive_fp); @@ -4758,10 +4753,9 @@ /* write_void_log() writes out a "void" log consisting of the message * which must either be a valid SQL query or a SQL comment. */ -int write_void_log (int node_id, char *seqbuf, const char *message) { +void write_void_log (int node_id, char *seqbuf, const char *message) { open_log_archive(node_id, seqbuf); generate_archive_header(node_id, seqbuf); submit_string_to_archive(message); close_log_archive(); } - Index: slon.c =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/slon.c,v retrieving revision 1.51 retrieving revision 1.52 diff -Lsrc/slon/slon.c -Lsrc/slon/slon.c -u -w -r1.51 -r1.52 --- src/slon/slon.c +++ src/slon/slon.c @@ -22,6 +22,7 @@ #include <signal.h> #include <sys/time.h> #include <sys/types.h> +#include <sys/wait.h> #include "libpq-fe.h" #include "c.h" @@ -77,7 +78,6 @@ PGconn *startup_conn; int c; int errors = 0; - int signo; char pipe_c; pid_t pid; extern int optind; Index: cleanup_thread.c =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/cleanup_thread.c,v retrieving revision 1.25 retrieving revision 1.26 diff -Lsrc/slon/cleanup_thread.c -Lsrc/slon/cleanup_thread.c -u -w -r1.25 -r1.26 --- src/slon/cleanup_thread.c +++ src/slon/cleanup_thread.c @@ -277,7 +277,6 @@ static unsigned long get_earliest_xid (PGconn *dbconn) { long long xid; - long n,t; PGresult *res; SlonDString query1; dstring_init(&query1);
- Previous message: [Slony1-commit] By cbbrowne: Added a section to "Best Practices" with tips on handling
- Next message: [Slony1-commit] By cbbrowne: Changes from Neil Conway: This patch fixes various issues
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list