]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix editing of PostgreSQL port
authorKern Sibbald <kern@sibbald.com>
Thu, 11 Mar 2004 08:42:13 +0000 (08:42 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 11 Mar 2004 08:42:13 +0000 (08:42 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1124 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/postgresql.c
bacula/src/dird/run_conf.c

index 611ad53a192468ab8e5721534d49bab6f5055d19..12fc80b7d2681fcddc068bb830ceb611f85c6819 100644 (file)
@@ -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 */
index a7999f2b0ae81e5ab70cb229392c85f18f32961b..2bf5050997025508befb26e356227d4f4a790ce6 100644 (file)
@@ -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 {