- commit_data_spool(jcr);
- }
-
- /* If the device is nor a tape, nor a fifo, and WritePartAfterJob
- * is set to yes, open the next part, so, in case of a device
- * that requires mount, it will be written to the device.
- */
- if (!(dcr->dev->state & (ST_TAPE|ST_FIFO)) && (jcr->write_part_after_job) && (dcr->dev->part_size > 0)) {
- Dmsg0(100, "Writing last part because write_part_after_job is set.\n");
- if (dcr->dev->part < dcr->dev->num_parts) {
- Jmsg3(dcr->jcr, M_FATAL, 0, _("Error while writing, current part number is less than the total number of parts (%d/%d, device=%s)\n"),
- dev->part, dev->num_parts, dev_name(dev));
- dcr->dev->dev_errno = EIO;
- ok = false;
- }
-
- if (ok && (open_next_part(dcr->dev) < 0)) {
- Jmsg2(jcr, M_FATAL, 0, _("Unable to open device next part %s. ERR=%s\n"),
- dev_name(dcr->dev), strerror_dev(dcr->dev));
- dcr->dev->dev_errno = EIO;
- ok = false;
- }
-
- dcr->dev->VolCatInfo.VolCatParts = dcr->dev->num_parts;