From 0762561a2011a11b845d7ca8a97353688096f6fe Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 11 Mar 2004 08:42:13 +0000 Subject: [PATCH] Fix editing of PostgreSQL port git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1124 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/cats/postgresql.c | 4 +++- bacula/src/dird/run_conf.c | 8 ++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index 611ad53a19..12fc80b7d2 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -133,7 +133,9 @@ db_open_database(JCR *jcr, B_DB *mdb) return 0; } - bsnprintf(port, sizeof(port), "%d", mdb->db_port); + if (mdb->db_port && mdb->db_port[0]) { + bsnprintf(port, sizeof(port), "%d", mdb->db_port); + } /* connect to the database */ mdb->db = PQsetdbLogin( mdb->db_address, /* default = localhost */ diff --git a/bacula/src/dird/run_conf.c b/bacula/src/dird/run_conf.c index a7999f2b0a..2bf5050997 100644 --- a/bacula/src/dird/run_conf.c +++ b/bacula/src/dird/run_conf.c @@ -374,7 +374,6 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) case s_mday: /* day of month */ if (!have_mday) { clear_bits(0, 30, lrun.mday); - clear_bits(0, 6, lrun.wday); have_mday = true; } set_bit(code, lrun.mday); @@ -389,7 +388,6 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) case s_wday: /* week day */ if (!have_wday) { clear_bits(0, 6, lrun.wday); - clear_bits(0, 30, lrun.mday); have_wday = true; } set_bit(code, lrun.wday); @@ -468,7 +466,6 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) } if (!have_mday) { clear_bits(0, 30, lrun.mday); - clear_bits(0, 6, lrun.wday); have_mday = true; } if (code < code2) { @@ -533,7 +530,6 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) if (state == s_wday) { if (!have_wday) { clear_bits(0, 6, lrun.wday); - clear_bits(0, 30, lrun.mday); have_wday = true; } if (code < code2) { @@ -544,14 +540,14 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) } } else if (state == s_month) { if (!have_month) { - clear_bits(0, 30, lrun.month); + clear_bits(0, 11, lrun.month); have_month = true; } if (code < code2) { set_bits(code, code2, lrun.month); } else { /* this is a bit odd, but we accept it anyway */ - set_bits(code, 30, lrun.month); + set_bits(code, 11, lrun.month); set_bits(0, code2, lrun.month); } } else { -- 2.39.5