Imported Upstream version 3.3.1
[debian/amanda] / server-src / tapefile.c
index b4212e5894238b47bc4d49e9801938ba26f4d78e..8e4400bf4a9d49a9a99933661fd80c2bf3c26317 100644 (file)
@@ -106,6 +106,8 @@ write_tapelist(
            g_fprintf(tapef, " BARCODE:%s", tp->barcode);
        if (tp->meta)
            g_fprintf(tapef, " META:%s", tp->meta);
+       if (tp->blocksize)
+           g_fprintf(tapef, " BLOCKSIZE:%jd", (intmax_t)tp->blocksize);
        if (tp->comment)
            g_fprintf(tapef, " #%s", tp->comment);
        g_fprintf(tapef, "\n");
@@ -421,6 +423,15 @@ parse_tapeline(
        tp->meta = NULL;
     }
 
+    if (strncmp_const(s - 1, "BLOCKSIZE:") == 0) {
+       s1 = s - 1 + 10;
+       skip_non_whitespace(s, ch);
+       s[-1] = '\0';
+       skip_whitespace(s, ch);
+       tp->blocksize = atol(s1);
+    } else {
+       tp->blocksize = 0;
+    }
     if (*(s - 1) == '#') {
        tp->comment = stralloc(s); /* skip leading '#' */
     } else {