Ignore:
Timestamp:
Sep 25, 2013, 8:55:43 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • Modification to 3.1 branch to make it extremely similar to 3.0. What remains are function rewrite with allocation in the function and desallocation outside of the function. Will be next step
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/mondo/src/common/libmondo-fork.c

    r3161 r3190  
    123123    char *cd_number_str = NULL;
    124124    char *command = NULL;
    125     char *p;
     125    char *p= NULL;
    126126    char *tmp1 = NULL;
    127127    char *tmp2 = NULL;
     
    140140
    141141    mr_asprintf(cd_number_str, "%d", cd_no);
     142    midway_call = resolve_naff_tokens(tmp1, isofile, "_ISO_");
    142143    log_msg(4, "basic call = '%s'", tmp1);
    143     midway_call = resolve_naff_tokens(tmp1, isofile, "_ISO_");
    144144    mr_free(tmp1);
    145145
     146    tmp = resolve_naff_tokens(midway_call, cd_number_str, "_CD#_");
    146147    log_msg(4, "midway_call = '%s'", midway_call);
    147     tmp = resolve_naff_tokens(midway_call, cd_number_str, "_CD#_");
    148148    mr_free(cd_number_str);
    149149    mr_free(midway_call);
    150150
    151     log_msg(4, "tmp = '%s'", tmp);
    152151    ultimate_call = resolve_naff_tokens(tmp, MONDO_LOGFILE, "_ERR_");
     152    log_msg(4, "ultimate call = '%s'", ultimate_call);
    153153    mr_free(tmp);
    154154
    155     log_msg(4, "ultimate call = '%s'", ultimate_call);
    156155    mr_asprintf(command, "%s >> %s", ultimate_call, MONDO_LOGFILE);
    157156    mr_free(ultimate_call);
    158157
    159     log_to_screen
    160         ("Please be patient. Do not be alarmed by on-screen inactivity.");
    161     log_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'",
    162             what_i_am_doing);
     158    log_to_screen("Please be patient. Do not be alarmed by on-screen inactivity.");
     159    log_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'", what_i_am_doing);
    163160    if (bkpinfo->manual_cd_tray) {
    164161        mr_asprintf(tmp2, "%s", command);
    165162        p = strstr(tmp2, "2>>");
    166163        if (p) {
    167             *p++ = ' ';
    168             *p++ = ' ';
    169             *p++ = ' ';
     164            sprintf(p, "   ");
    170165            while (*p == ' ') {
    171166                p++;
     
    376371        return (1);
    377372    }
    378     mr_free(command);
    379373
    380374    if (!does_file_exist(lockfile)) {
     
    384378        }
    385379    }
     380    mr_free(command);
    386381
    387382    for (; does_file_exist(lockfile); sleep(1)) {
     
    535530            bytes_to_be_read = atol(tmp1);
    536531        }
     532    }
     533
     534    if (direction == 'w') {
     535        mr_asprintf(tmp, "%-64s", PIMP_END_SZ);
     536        if (fwrite(tmp, 1, 64, fout) != 64) {
     537            mr_free(tmp);
     538            fatal_error("Can't write the final block");
     539        }
     540        mr_free(tmp);
     541    } else {
    537542        log_msg(1, "tmpA is %s", tmp1);
    538543        if (!strstr(tmp1, PIMP_END_SZ)) {
     
    554559                }
    555560
    556                 sprintf(tmp, "I am here - %lld", (long long)ftello(fin));
     561                mr_asprintf(tmp, "I am here - %lld", (long long)ftello(fin));
    557562                if (fread(tmp, 1, tmpcap, fin)) {
     563                    mr_free(tmp);
    558564                    fatal_error("Can't fread here");
    559565                }
    560566                log_msg(0, "tmp = '%s'", tmp);
    561567                if (fwrite(tmp, 1, tmpcap, ftmp)) {
     568                    mr_free(tmp);
    562569                    fatal_error("Can't fwrite there");
    563570                }
    564571                fclose(ftmp);
    565                 mr_free(tmp1);
     572                mr_free(tmp);
    566573                fatal_error("Missing terminating block");
    567574            }
    568575        }
    569         mr_free(tmp1);
    570     }
     576    }
     577    mr_free(tmp1);
    571578
    572579    paranoid_free(buf);
     
    595602    command = find_home_of_exe("ntfsclone");
    596603    if (!command) {
    597         mr_free(command);
    598604        fatal_error("ntfsclone not found");
    599605    }
     
    641647    /*@ buffers *********************************************************** */
    642648    char *command = NULL;
    643     char *title = NULL;
    644649    /*@ pointers ********************************************************** */
    645650    static int chldres = 0;
     
    659664
    660665    log_msg(8, "Parent running");
    661     mr_asprintf(title, "%s", tt);
    662     open_evalcall_form(title);
    663     mr_free(title);
     666    open_evalcall_form(tt);
    664667
    665668    for (sleep(1); command[0] != '\0'; sleep(1)) {
     
    672675        if (pcno <= 5 && last_pcno >= 40) {
    673676            close_evalcall_form();
    674             mr_asprintf(title, "Verifying...");
    675             open_evalcall_form(title);
    676             mr_free(title);
     677            open_evalcall_form("Verifying...");
    677678        }
    678679        if (counter++ >= 5) {
Note: See TracChangeset for help on using the changeset viewer.