]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Modify migrate not to fail if nothing found to migrate.
authorKern Sibbald <kern@sibbald.com>
Wed, 6 Dec 2006 08:39:18 +0000 (08:39 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 6 Dec 2006 08:39:18 +0000 (08:39 +0000)
kes  Add #undef HAVE_OPENSSL, HAVE_TLS, HAVE_CYRPTO to autoconf/config.h.in
     because they were not always set correctly.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3758 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/config.h.in
bacula/autoconf/config.h.in.save
bacula/src/dird/migrate.c
bacula/src/version.h
bacula/technotes-1.39

index 082f6410a67251459424a648879d0071f15b9971..45f330ca048e71f254e08e79d53dcdbefcdce77a 100644 (file)
 /* Define to `int' if <sys/types.h> doesn't define. */
 #undef uid_t
 
-/* Define to system config director */
+/* Define to system config directory */
 #undef SYSCONFDIR
+
+/* Define if OPENSSL is available */
+#undef HAVE_OPENSSL
+
+/* Define if comm encryption should be enabled */
+#undef HAVE_TLS
+
+/* Define if data encryption should be enabled */
+#undef HAVE_CRYPTO
index 082f6410a67251459424a648879d0071f15b9971..45f330ca048e71f254e08e79d53dcdbefcdce77a 100644 (file)
 /* Define to `int' if <sys/types.h> doesn't define. */
 #undef uid_t
 
-/* Define to system config director */
+/* Define to system config directory */
 #undef SYSCONFDIR
+
+/* Define if OPENSSL is available */
+#undef HAVE_OPENSSL
+
+/* Define if comm encryption should be enabled */
+#undef HAVE_TLS
+
+/* Define if data encryption should be enabled */
+#undef HAVE_CRYPTO
index ada5652471610ff37a91c08e6704cac13fb63c1c..6c5114c9f69f4cd17fbfac5fa0c0937aab4e7ea6 100644 (file)
@@ -54,7 +54,7 @@
 static const int dbglevel = 10;
 
 static char OKbootstrap[] = "3000 OK bootstrap\n";
-static bool get_job_to_migrate(JCR *jcr);
+static int get_job_to_migrate(JCR *jcr);
 struct idpkt;
 static bool regex_find_jobids(JCR *jcr, idpkt *ids, const char *query1,
                  const char *query2, const char *type);
@@ -96,11 +96,17 @@ bool do_migration_init(JCR *jcr)
    char ed1[100];
    JOB *job, *prev_job;
    JCR *mig_jcr;                   /* newly migrated job */
+   int count;
 
    /* If we find a job or jobs to migrate it is previous_jr.JobId */
-   if (!get_job_to_migrate(jcr)) {
+   count = get_job_to_migrate(jcr);
+   if (count < 0) {
       return false;
    }
+   if (count == 0) {
+      return true;
+   }
+
    Dmsg1(dbglevel, "Back from get_job_to_migrate JobId=%d\n", (int)jcr->JobId);
 
    if (jcr->previous_jr.JobId == 0) {
@@ -547,10 +553,11 @@ const char *sql_pool_time =
  *   one starting a new job with MigrationJobId set to that JobId, and
  *   finally, it returns the last JobId to the caller.
  *
- * Returns: false on error
- *          true  if OK and jcr->previous_jr filled in
+ * Returns: -1  on error
+ *           0  if no jobs to migrate
+ *           1  if OK and jcr->previous_jr filled in
  */
-static bool get_job_to_migrate(JCR *jcr)
+static int get_job_to_migrate(JCR *jcr)
 {
    char ed1[30];
    POOL_MEM query(PM_MESSAGE);
@@ -561,10 +568,10 @@ static bool get_job_to_migrate(JCR *jcr)
    idpkt ids, mid, jids;
    db_int64_ctx ctx;
    int64_t pool_bytes;
-   bool ok;
    time_t ttime;
    struct tm tm;
    char dt[MAX_TIME_LENGTH];
+   int count = 0;
 
    ids.list = get_pool_memory(PM_MESSAGE);
    ids.list[0] = 0;
@@ -678,8 +685,7 @@ static bool get_job_to_migrate(JCR *jcr)
             }
             mid.count = 1;
             Mmsg(mid.list, "%s", edit_int64(MediaId, ed1));
-            ok = find_jobids_from_mediaid_list(jcr, &mid, "Volumes");
-            if (!ok) {
+            if (!find_jobids_from_mediaid_list(jcr, &mid, "Volumes")) {
                continue;
             }
             if (i != 0) {
@@ -760,7 +766,7 @@ static bool get_job_to_migrate(JCR *jcr)
          goto bail_out;
       } else if (stat == 0) {
          Jmsg(jcr, M_INFO, 0, _("No JobIds found to migrate.\n"));
-         goto bail_out;
+         goto ok_out;
       }
    }
    
@@ -773,7 +779,7 @@ static bool get_job_to_migrate(JCR *jcr)
       goto bail_out;
    } else if (stat == 0) {
       Jmsg(jcr, M_INFO, 0, _("No JobIds found to migrate.\n"));
-      goto bail_out;
+      goto ok_out;
    }
 
    jcr->previous_jr.JobId = JobId;
@@ -790,19 +796,19 @@ static bool get_job_to_migrate(JCR *jcr)
    Dmsg3(dbglevel, "Migration JobId=%d  using JobId=%s Job=%s\n",
       jcr->JobId,
       edit_int64(jcr->previous_jr.JobId, ed1), jcr->previous_jr.Job);
+   count = 1;
 
 ok_out:
-   ok = true;
    goto out;
 
 bail_out:
-   ok = false;
+   count = -1;
            
 out:
    free_pool_memory(ids.list);
    free_pool_memory(mid.list);
    free_pool_memory(jids.list);
-   return ok;
+   return count;
 }
 
 static void start_migration_job(JCR *jcr)
index 12a34b7f0a81b825b12cf17f8ade5d0ff9b3f9ee..773168bfbb2ca4c3792d7b038b1a87fd0aadd1af 100644 (file)
@@ -3,9 +3,9 @@
  */
 
 #undef  VERSION
-#define VERSION "1.39.29"
-#define BDATE   "05 December 2006"
-#define LSMDATE "05Dec06"
+#define VERSION "1.39.30"
+#define BDATE   "06 December 2006"
+#define LSMDATE "06Dec06"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2006 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2006"       /* year for copyright messages in progs */
index 84d17edb78beefecdc35864d3676024ae9a9da71..96c755101c23f54ae1760e8c9a95083ef6901108 100644 (file)
@@ -1,6 +1,10 @@
               Technical notes on version 1.39  
 
 General:
+06Dec06
+kes  Modify migrate not to fail if nothing found to migrate. 
+kes  Add #undef HAVE_OPENSSL, HAVE_TLS, HAVE_CYRPTO to autoconf/config.h.in
+     because they were not always set correctly.
 05Dec06
 kes  Update configure.in to include python 2.5 search.
 kes  Back out unwanted migration change reported by Richard Mortimer.