]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/newvol.c
Add heap stats to Dir and SD -- eliminate #ifdefs
[bacula/bacula] / bacula / src / dird / newvol.c
index 380c8c98ba617bf244477c9566bc6833227cf669..0863e67014b4ad026b1db2df2060a3c30ae368e9 100644 (file)
@@ -13,7 +13,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2001-2004 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -41,11 +41,9 @@ static int perform_full_name_substitution(JCR *jcr, MEDIA_DBR *mr, POOL_DBR *pr)
 
 
 /*
- * Really crude automatic Volume name creation using
- *  LabelFormat. We assume that if this routine is being
- *  called the Volume will be labeled, so we set the LabelDate.
+ * Automatic Volume name creation using the LabelFormat
  */
-int newVolume(JCR *jcr, MEDIA_DBR *mr)
+bool newVolume(JCR *jcr, MEDIA_DBR *mr)
 {
    POOL_DBR pr;
 
@@ -59,7 +57,6 @@ int newVolume(JCR *jcr, MEDIA_DBR *mr)
       if (pr.MaxVols == 0 || pr.NumVols < pr.MaxVols) {
         memset(mr, 0, sizeof(MEDIA_DBR));
         set_pool_dbr_defaults_in_media_dbr(mr, &pr);
-        mr->LabelDate = time(NULL);
         bstrncpy(mr->MediaType, jcr->store->media_type, sizeof(mr->MediaType));
         /* Check for special characters */
         if (is_volume_name_legal(NULL, pr.LabelFormat)) {
@@ -84,7 +81,7 @@ int newVolume(JCR *jcr, MEDIA_DBR *mr)
            db_unlock(jcr->db);
             Jmsg(jcr, M_INFO, 0, _("Created new Volume \"%s\" in catalog.\n"), mr->VolumeName);
             Dmsg1(90, "Created new Volume=%s\n", mr->VolumeName);
-           return 1;
+           return true;
         } else {
             Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db));
         }
@@ -92,7 +89,7 @@ int newVolume(JCR *jcr, MEDIA_DBR *mr)
    }
 bail_out:
    db_unlock(jcr->db);
-   return 0;   
+   return false;
 }
 
 static int create_simple_name(JCR *jcr, MEDIA_DBR *mr, POOL_DBR *pr)