]> git.sur5r.net Git - bacula/bacula/commitdiff
Cut 3 ANSI labels
authorKern Sibbald <kern@sibbald.com>
Wed, 2 Feb 2005 23:13:23 +0000 (23:13 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 2 Feb 2005 23:13:23 +0000 (23:13 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1812 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/label.c

index 47fd0d1e979e452e226cc70556a646bda5bf739e..d978330b055520a01850e133cef849cb9f7b1326 100644 (file)
@@ -987,7 +987,7 @@ bool write_ansi_ibm_label(DCR *dcr, const char *VolName)
       ser_begin(label, sizeof(label));
       ser_bytes("VOL1", 4);
       ser_bytes(VolName, len);
-      label[79] = '1';                /* ANSI label flag */
+      label[79] = '3';                /* ANSI label flag */
       /* Write VOL1 label */
       stat = write(dev->fd, label, sizeof(label));
       if (stat != sizeof(label)) {
@@ -1010,7 +1010,7 @@ bool write_ansi_ibm_label(DCR *dcr, const char *VolName)
       ser_begin(&label[21], sizeof(label)-21);
       ser_bytes(VolName, len);       /* write Vol Ser No. */
       ser_begin(&label[27], sizeof(label)-27);
-      ser_bytes("000100010001", 12);  /* File section, File seq no, Generation no */
+      ser_bytes("00010001000100", 14);  /* File section, File seq no, Generation no */
       now = time(NULL);
       ser_bytes(ansi_date(now, date), 6); /* current date */
       ser_bytes(ansi_date(now - 24 * 3600, date), 6); /* created yesterday */
@@ -1100,6 +1100,6 @@ static char *ansi_date(time_t td, char *buf)
       td = time(NULL);
    }
    tm = gmtime(&td);
-   bsnprintf(buf, 10, "%d  ", 1000 * (tm->tm_year + 1900 - 2000) + tm->tm_yday);
+   bsnprintf(buf, 10, " %05d ", 1000 * (tm->tm_year + 1900 - 2000) + tm->tm_yday);
    return buf;
 }