]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/getmsg.c
Keep the same keywords as in previous version
[bacula/bacula] / bacula / src / dird / getmsg.c
index 60e7aed439ae9c23daa3b4c5539e7996c9372381..2aa5999f6432c8ed38c8246aab5dd4db78fc8031 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -45,7 +45,6 @@
  *       Requests are any message that does not begin with a digit.
  *       In affect, they are commands.
  *
- *   Version $Id$
  */
 
 #include "bacula.h"
@@ -71,7 +70,7 @@ static char Device_update[]   = "DevUpd Job=%127s "
 static char OK_msg[] = "1000 OK\n";
 
 
-void set_jcr_sd_job_status(JCR *jcr, int SDJobStatus)
+static void set_jcr_sd_job_status(JCR *jcr, int SDJobStatus)
 {
    bool set_waittime=false;
    Dmsg2(800, "set_jcr_sd_job_status(%s, %c)\n", jcr->Job, SDJobStatus);
@@ -125,7 +124,7 @@ void set_jcr_sd_job_status(JCR *jcr, int SDJobStatus)
  */
 int bget_dirmsg(BSOCK *bs)
 {
-   int32_t n;
+   int32_t n = BNET_TERMINATE;
    char Job[MAX_NAME_LENGTH];
    char MsgType[20];
    int type;
@@ -133,11 +132,11 @@ int bget_dirmsg(BSOCK *bs)
    JCR *jcr = bs->jcr();
    char *msg;
 
-   for (;;) {
+   for ( ; !bs->is_stop() && !bs->is_timed_out(); ) {
       n = bs->recv();
       Dmsg2(100, "bget_dirmsg %d: %s\n", n, bs->msg);
 
-      if (is_bnet_stop(bs)) {
+      if (bs->is_stop() || bs->is_timed_out()) {
          return n;                    /* error or terminate */
       }
       if (n == BNET_SIGNAL) {          /* handle signal */
@@ -328,6 +327,7 @@ int bget_dirmsg(BSOCK *bs)
 #endif
       return n;
    }
+   return n;
 }
 
 static char *find_msg_start(char *msg)