]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/status.c
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / src / filed / status.c
index fdeb2abf57f58690018a8fc633883c2266e922f2..4962da52e5aad003bd66e4ada2e4a8fed08d8aaf 100755 (executable)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2001-2005 Kern Sibbald
+   Copyright (C) 2001-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -156,7 +156,6 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
       }
       sendit(msg, len, arg);
       if (njcr->JobId == 0) {
-         free_jcr(njcr);
          continue;
       }
       sec = time(NULL) - njcr->start_time;
@@ -173,9 +172,9 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
            edit_uint64_with_commas(njcr->num_files_examined, b1));
       sendit(msg, len, arg);
       if (njcr->JobFiles > 0) {
-         P(njcr->mutex);
+         njcr->lock();
          len = Mmsg(msg, _("    Processing file: %s\n"), njcr->last_fname);
-         V(njcr->mutex);
+         njcr->unlock();
          sendit(msg, len, arg);
       }
 
@@ -188,8 +187,9 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
          len = Mmsg(msg, _("    SDSocket closed.\n"));
          sendit(msg, len, arg);
       }
-      free_jcr(njcr);
    }
+   endeach_jcr(njcr);
+
    Dmsg0(1000, "Begin status jcr loop.\n");
    if (!found) {
       len = Mmsg(msg, _("No Jobs running.\n"));
@@ -334,8 +334,8 @@ int qstatus_cmd(JCR *jcr)
          if (njcr->JobId != 0) {
             bnet_fsend(dir, DotStatusJob, njcr->JobId, njcr->JobStatus, njcr->JobErrors);
          }
-         free_jcr(njcr);
       }
+      endeach_jcr(njcr);
    } else if (strcmp(time, "last") == 0) {
       bnet_fsend(dir, OKqstatus, time);
       if ((last_jobs) && (last_jobs->size() > 0)) {
@@ -460,11 +460,11 @@ char *bac_status(char *buf, int buf_len)
       if (njcr->JobId != 0) {
          stat = JS_Running;
          termstat = _("Bacula Running");
-         free_jcr(njcr);
          break;
       }
-      free_jcr(njcr);
    }
+   endeach_jcr(njcr);
+
    if (stat != 0) {
       goto done;
    }