Ignore:
Timestamp:
May 27, 2008, 1:32:48 PM (11 years ago)
Author:
bruno
Message:
  • Some log for OBDR
  • skip_obdr returns 0 if OK
  • Fix typo
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mondo/src/common/libmondo-stream.c

    r1954 r1955  
    679679 * @param tapedev The tape device to open for reading.
    680680 */
    681 void skip_obdr()
     681int skip_obdr()
    682682{
    683683    char *command = NULL;
    684 
     684    int res = 0;
     685
     686    log_it("Skipping OBDR headers");
    685687    asprintf(&command, "mt -f %s fsf 2",bkpinfo->media_device);
    686     run_program_and_log_output(command, 1);
     688    res = run_program_and_log_output(command, 1);
    687689    paranoid_free(command);
    688690
    689691    set_tape_block_size_with_mt(bkpinfo->internal_tape_block_size);
    690 
     692    return(res);
    691693}
    692694
     
    704706    int res = 0;
    705707
     708    log_it("Creating OBDR headers");
    706709    /* OBDR: First block 10 kB of zero bs = 512 */
    707710    asprintf(&command, "mt -f %s compression off",bkpinfo->media_device);
     
    710713
    711714    asprintf(&command, "mt -f %s rewind",bkpinfo->media_device);
    712     res = run_program_and_log_output(command, 1);
     715    res += run_program_and_log_output(command, 1);
    713716    paranoid_free(command);
    714717
     
    716719
    717720    asprintf(&command, "dd if=/dev/zero of=%s bs=512 count=20",bkpinfo->media_device);
    718     res = run_program_and_log_output(command, 1);
     721    res += run_program_and_log_output(command, 1);
    719722    paranoid_free(command);
    720723
     
    723726
    724727    asprintf(&command, "dd if=%s of=%s bs=2048",MINDI_CACHE"/mondorescue.iso",bkpinfo->media_device);
    725     res = run_program_and_log_output(command, 1);
     728    res += run_program_and_log_output(command, 1);
    726729    paranoid_free(command);
    727730
    728731    set_tape_block_size_with_mt(bkpinfo->internal_tape_block_size);
     732    return(res);
    729733}
    730734
     
    750754    int i;
    751755    int j;
    752     int res;
     756    int res = 0;
    753757    long length, templong;
    754758    size_t k;
     
    777781    if ((bkpinfo->use_obdr) && (ntapedev != NULL)) {
    778782        strncpy(bkpinfo->media_device,ntapedev,(size_t)(MAX_STR_LEN / 4));
    779         skip_obdr();
     783        res = skip_obdr();
     784        if (res != 0) {
     785            log_it("Not able to skip OBDR - Restore will have to be done manually");
     786        }
    780787    } else {
    781788        if (ntapedev == NULL) {
     
    930937if (!
    931938    (g_tape_stream =
    932      open_device_via_buffer(tapedev, 'w', bkpinfo->internal_tape_block_size))) {
     939     open_device_via_buffer(bkpinfo->media_device, 'w', bkpinfo->internal_tape_block_size))) {
    933940    log_OS_error(g_tape_fifo);
    934941    log_to_screen("Cannot openin stream device");
Note: See TracChangeset for help on using the changeset viewer.