Ignore:
Timestamp:
Sep 29, 2013, 7:27:11 PM (11 years ago)
Author:
Bruno Cornec
Message:
  • Fix all compilation/link error due to the previous giant merge with 3.1. 3.2 is ready to test
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/common/libmondo-files.c

    r3191 r3194  
    291291    log_it("Calling Mindi with kernel path of '%s'", kernel);
    292292    while (!kernel[0]) {
    293         if (!ask_me_yes_or_no
    294             ("Kernel not found or invalid. Choose another?")) {
     293        if (!ask_me_yes_or_no("Kernel not found or invalid. Choose another?")) {
    295294            return (1);
    296295        }
    297         if (!popup_and_get_string
    298             ("Kernel path",
    299              "What is the full path and filename of your kernel, please?",
    300              kernel, MAX_STR_LEN / 4)) {
    301             fatal_error
    302                 ("Kernel not found. Please specify with the '-k' flag.");
     296        if (!popup_and_get_string("Kernel path", "What is the full path and filename of your kernel, please?", kernel, MAX_STR_LEN / 4)) {
     297            fatal_error("Kernel not found. Please specify with the '-k' flag.");
    303298        }
    304299        log_it("User says kernel is at %s", kernel);
     
    335330            mr_free(incoming);
    336331            output[0] = '\0';
    337             return (NULL);      // forget it :)
     332            return(NULL);       // forget it :)
    338333        }
    339334        mr_asprintf(command, "file %s 2> /dev/null | cut -d':' -f1 2> /dev/null", incoming);
    340         mr_free(incomig);
     335        mr_free(incoming);
    341336
    342337        mr_asprintf(incoming, "%s", call_program_and_get_last_line_of_output(command));
     
    352347    strcpy(output, incoming);
    353348    if (output[0] != '\0' && does_file_exist(output)) {
    354         log_msg(4, "find_home_of_exe () --- Found %s at %s", fname, incoming);
     349        log_msg(4, "find_home_of_exe --- Found %s at %s", fname, incoming);
    355350    } else {
    356351        output[0] = '\0';
    357         log_msg(4, "find_home_of_exe() --- Could not find %s", fname);
     352        log_msg(4, "find_home_of_exe --- Could not find %s", fname);
    358353    }
    359354    mr_free(incoming);
    360355    if (!output[0]) {
    361         return (NULL);
     356        return(NULL);
    362357    } else {
    363         return (output);
     358        return(output);
    364359    }
    365360}
     
    433428        if (!lastline[0]) {
    434429            mr_free(lastline);
    435             return (0);
     430            return(0);
    436431        }
    437432    } else {
     
    444439    } else {
    445440        mr_free(lastline);
    446         return (0);
     441        return(0);
    447442    }
    448443
     
    453448    i = atoi(p);
    454449    mr_free(lastline);
    455     return (i);
     450    return(i);
    456451}
    457452
     
    471466    static char output[MAX_STR_LEN];
    472467    char *command = NULL;
     468    char *p = NULL;
    473469
    474470    /*@ pointers **************************************************** */
     
    478474
    479475    if (!does_file_exist(filename)) {
    480         log_it("Tring to get last line of nonexistent file (%s)", filename);
     476        log_it("Trying to get last line of nonexistent file (%s)", filename);
    481477        output[0] = '\0';
    482478        return (output);
     
    493489        output[strlen(output) - 1] = '\0';
    494490    }
    495     return (output);
     491    return(output);
    496492}
    497493
     
    513509        log_it("filename=%s", filename);
    514510        log_OS_error("Unable to openin filename");
    515         return (-1);
     511        return(-1);
    516512    }
    517513    fseeko(fin, 0, SEEK_END);
    518514    length = ftello(fin);
    519515    paranoid_fclose(fin);
    520     return (length);
     516    return(length);
    521517}
    522518
     
    561557        log_OS_error("Unable to fopen-in filelist");
    562558        log_to_screen("Can't open filelist");
    563         return (1);
     559        return(1);
    564560    }
    565561    fout = fopen(cksumlist, "w");
     
    568564        paranoid_fclose(fin);
    569565        log_to_screen("Can't open checksum list");
    570         return (1);
     566        return(1);
    571567    }
    572568    for (mr_getline(stub_fname, fin); !feof(fin); mr_getline(stub_fname, fin)) {
    573         if (stub_fname[(i = strlen(stub_fname) - 1)] < 32) {
     569        i = strlen(stub_fname) - 1;
     570        if (stub_fname[i] < 32) {
    574571            stub_fname[i] = '\0';
    575572        }
     
    605602    paranoid_fclose(fin);
    606603    log_it("Done.");
    607     return (0);
     604    return(0);
    608605}
    609606
     
    623620    res = system(tmp);
    624621    mr_free(tmp);
    625     return (res);
     622    return(res);
    626623}
    627624
     
    659656
    660657    unlink(outfile_fname);
    661     return (0);
     658    return(0);
    662659}
    663660
     
    687684    if (!fin) {
    688685        log_OS_error("Unable to openin filelist_fname");
    689         return (0);
     686        return(0);
    690687    }
    691688    mr_getline(incoming, fin);
     
    699696    mr_free(incoming);
    700697    paranoid_fclose(fin);
    701     return (matches);
     698    return(matches);
    702699}
    703700
     
    728725    mr_free(command);
    729726
    730     return (file_len_K);
     727    return(file_len_K);
    731728}
    732729
     
    806803    paranoid_fclose(fin);
    807804    log_it("Finished calculating total size of all biggiefiles");
    808     return (scratchL);
     805    return(scratchL);
    809806}
    810807
     
    848845    mr_free(command);
    849846
    850     return (llres);
     847    return(llres);
    851848}
    852849
     
    864861    tmp = (crc >> 8) ^ c;
    865862    crc = (crc << 8) ^ crctttab[tmp & 255];
    866     return crc;
     863    return(crc);
    867864}
    868865
     
    879876    tmp = crc ^ c;
    880877    crc = (crc >> 8) ^ crc16tab[tmp & 0xff];
    881     return crc;
     878    return(crc);
    882879}
    883880
     
    905902        log_to_screen("There may be hyperlink at http://www.mondorescue.org which");
    906903        log_to_screen("will take you to the relevant (missing) package.");
    907         return (1);
     904        return(1);
    908905    } else {
    909         return (0);
     906        return(0);
    910907    }
    911908}
     
    969966        log_it("fname=%s", fname);
    970967        log_OS_error("Unable to openin fname");
    971         return (1);
     968        return(1);
    972969    }
    973970    res = fscanf(fin, "%s\n", contents);
     
    978975    paranoid_fclose(fin);
    979976    res = 0;
    980     return (res);
    981 }
    982 
    983 
    984 
     977    return(res);
     978}
    985979
    986980
     
    10841078    mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    10851079}
    1086 
    1087 
    1088 
    10891080
    10901081
     
    11151106    char *p;
    11161107
    1117     if (! bkpinfo->netfs_mount) {
     1108    if (bkpinfo->netfs_mount == NULL) {
    11181109        fatal_error("No netfs_mount found !");
    11191110    }
     
    11521143
    11531144    mr_asprintf(command, "ifconfig %s | head -1 | awk '{print $5}'", netfs_dev);
    1154     mr_asprintf(netfs_client_hwaddr, "%s" call_program_and_get_last_line_of_output(command));
     1145    mr_asprintf(netfs_client_hwaddr, "%s", call_program_and_get_last_line_of_output(command));
    11551146    mr_free(command);
    11561147
     
    12291220    mr_free(tmp);
    12301221
    1231     sprintf(tmp, "%s/NETFS-PROTO", bkpinfo->tmpdir);
     1222    mr_asprintf(tmp, "%s/NETFS-PROTO", bkpinfo->tmpdir);
    12321223    write_one_liner_data_file(tmp, bkpinfo->netfs_proto);
    12331224    mr_free(tmp);
Note: See TracChangeset for help on using the changeset viewer.