]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix run pool problem + remove bad ASSERTs
authorKern Sibbald <kern@sibbald.com>
Tue, 27 Jan 2004 21:00:46 +0000 (21:00 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 27 Jan 2004 21:00:46 +0000 (21:00 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1020 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/cats/drop_mysql_database.in
bacula/src/cats/drop_sqlite_database.in
bacula/src/cats/sql_list.c
bacula/src/dird/ua_restore.c
bacula/src/filed/win32/bin/chmod.exe [new file with mode: 0644]
bacula/src/lib/bnet_server.c

index 89de4c46fa1179cda54d3087125a31ad662e5a27..b5919192317c76bf8052f161b0bd402b8b72f581 100644 (file)
@@ -1,5 +1,5 @@
                  Kern's ToDo List
-                 17 January 2004
+                 27 January 2004
 
 Documentation to do: (any release a little bit at a time)
 - Document running a test version.
@@ -249,6 +249,13 @@ For 1.33
   In SD allow Device to have Multiple MediaTypes
 
 After 1.33:
+- Look at www.nu2.nu/pebuilder as a helper for full windows
+  bare metal restore.
+From Chris Hull:
+   it seems to be complaining about 12:00pm which should be a valid 12
+   hour time.  I changed the time to 11:59am and everything works fine.
+   Also 12:00am works fine.  0:00pm also works (which I don't think
+   should).  None of the values 12:00pm - 12:59pm work for that matter.
 Ideas from Jerry Scharf:
   First let's point out some big pluses that bacula has for this
         it's open source
index e5dfb60e8ccee060bfa92452c9a7f312694e027e..ff9ff481da45f04f9e16b35b0e03d0653f036243 100644 (file)
@@ -5,12 +5,16 @@
 
 bindir=@SQL_BINDIR@
 
-if $bindir/mysql $* -f <<END-OF-DATA
-DROP DATABASE bacula;
-END-OF-DATA
-then
-   echo "Drop of bacula database succeeded."
+if test xmysql = x@DB_NAME@ ; then 
+  if $bindir/mysql $* -f <<END-OF-DATA
+    DROP DATABASE bacula;
+    END-OF-DATA
+  then
+    echo "Drop of bacula database succeeded."
+  else
+    echo "Drop of bacula database failed."
+  fi
 else
-   echo "Drop of bacula database failed."
+  echo "Bacula is not configured for a MySQL database."
 fi
 exit 0
index ece801c9b68cdf5ae76adc9a188995b47b23e7a4..c937cdb88e9994b9a09e57bf8d3000e72b83e8d6 100644 (file)
@@ -2,5 +2,9 @@
 #
 # shell script to drop Bacula SQLite tables
 
-cd @working_dir@
-rm -rf bacula.db
+if test xsqlite = x@DB_NAME@ ; then 
+  cd @working_dir@
+  rm -rf bacula.db
+else
+  echo "Bacula is not configured for an SQLite database."
+fi
index 6541f3a27f4c45e05bfac10f5b32509619f6c21b..4edbdddd579aff1922df5e8ae540fd7fd3fcf3ff 100644 (file)
@@ -301,15 +301,23 @@ AS Files,sum(JobBytes) As Bytes FROM Job");
    db_unlock(mdb);
 }
 
+/* 
+ * Stupid MySQL is NON-STANDARD !  
+ */
+#ifdef HAVE_MYSQL
+#define FN "CONCAT(Path.Path,Filename.Name)"
+#else
+#define FN "Path.Path||Filename.Name"
+#endif
 
 void
 db_list_files_for_job(JCR *jcr, B_DB *mdb, uint32_t jobid, DB_LIST_HANDLER *sendit, void *ctx)
 {
    db_lock(mdb);
 
-   Mmsg(&mdb->cmd, "SELECT Path.Path,Filename.Name FROM File,\
-Filename,Path WHERE File.JobId=%u AND Filename.FilenameId=File.FilenameId \
-AND Path.PathId=File.PathId",
+   Mmsg(&mdb->cmd, "SELECT " FN " AS Filename FROM File,"
+"Filename,Path WHERE File.JobId=%u AND Filename.FilenameId=File.FilenameId "
+"AND Path.PathId=File.PathId",
       jobid);
 
    if (!QUERY_DB(jcr, mdb, mdb->cmd)) {
index 137bd848837642435f62c3abc98dba8acd19a46b..cdadff6116cea899c266a4e06877916abb981cc9 100644 (file)
@@ -592,6 +592,7 @@ static int insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *fi
    strip_trailing_junk(file);
    split_path_and_filename(rx, file);
    Mmsg(&rx->query, uar_jobid_fileindex, date, rx->path, rx->fname, rx->ClientName);
+   Dmsg1(000, "Query=%s\n", rx->query);
    rx->found = false;
    /* Find and insert jobid and File Index */
    if (!db_sql_query(ua->db, rx->query, jobid_fileindex_handler, (void *)rx)) {
diff --git a/bacula/src/filed/win32/bin/chmod.exe b/bacula/src/filed/win32/bin/chmod.exe
new file mode 100644 (file)
index 0000000..18078e1
Binary files /dev/null and b/bacula/src/filed/win32/bin/chmod.exe differ
index c4b2a76ddf9ec485d767a3f7e66bcdb05e66c0c3..3f5ccf0b205cf23e22f7f7494832bc1d9098ce98 100644 (file)
@@ -128,7 +128,7 @@ bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_w
       FD_SET(sockfd, &sockset);
       errno = 0;
       if ((stat = select(sockfd+1, &sockset, NULL, NULL, NULL)) < 0) {
-        if (errno == EINTR) {
+        if (errno == EINTR || errno == EAGAIN) {
            continue;
         }
         /* Error, get out */
@@ -141,7 +141,7 @@ bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_w
       do {
         clilen = sizeof(cli_addr);
         newsockfd = accept(sockfd, (struct sockaddr *)&cli_addr, &clilen);
-      } while (newsockfd < 0 && errno == EINTR);
+      } while (newsockfd < 0 && (errno == EINTR || errno == EAGAIN));
       if (newsockfd < 0) {
         continue;
       }
@@ -212,7 +212,7 @@ bnet_bind(int port)
     * Open a TCP socket  
     */
    for (tlog=0; (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0; tlog -= 10 ) {
-      if (errno == EINTR) {
+      if (errno == EINTR || errno == EAGAIN) {
         continue;
       }
       if (tlog <= 0) {
@@ -238,7 +238,7 @@ bnet_bind(int port)
    serv_addr.sin_port = htons(port);
 
    for (tlog=0; bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0; tlog -= 5 ) {
-      if (errno == EINTR) {
+      if (errno == EINTR || errno == EAGAIN) {
         continue;
       }
       if (tlog <= 0) {
@@ -280,7 +280,7 @@ bnet_accept(BSOCK *bsock, char *who)
        */
       ready = sockset;
       if ((stat = select(bsock->fd+1, &ready, NULL, NULL, NULL)) < 0) {
-        if (errno == EINTR) {
+        if (errno == EINTR || errno = EAGAIN) {
            errno = 0;
            continue;
         }
@@ -291,7 +291,7 @@ bnet_accept(BSOCK *bsock, char *who)
       do {
         clilen = sizeof(cli_addr);
         newsockfd = accept(bsock->fd, (struct sockaddr *)&cli_addr, &clilen);
-      } while (newsockfd < 0 && errno == EINTR);
+      } while (newsockfd < 0 && (errno == EINTR || errno = EAGAIN));
       if (newsockfd >= 0) {
         break;
       }