Changeset 1081 in MondoRescue for trunk/mondo/src/common


Ignore:
Timestamp:
Jan 28, 2007, 11:20:07 PM (17 years ago)
Author:
Bruno Cornec
Message:

merge -r1078:1080 $SVN_M/branches/stable

Location:
trunk/mondo/src/common
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/src/common/libmondo-archive.c

    r1079 r1081  
    820820
    821821    if (g_getfattr) {
    822         asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir);
     822        mr_asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir);
    823823        if (write_one_liner_data_file(tmp1, "TRUE")) {
    824824            log_msg(1, "%ld: Unable to write one-liner XATTR",
     
    828828    }
    829829    if (g_getfacl) {
    830         asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir);
     830        mr_asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir);
    831831        if (write_one_liner_data_file(tmp1, "TRUE")) {
    832832            log_msg(1, "%ld: Unable to write one-liner ACL",
     
    860860
    861861    if (bkpinfo->backup_media_type == usb) {
    862         asprintf(&tmp2, "--usb %s", bkpinfo->media_device);
    863     } else {
    864         asprintf(&tmp2,"");
     862        mr_asprintf(&tmp2, "--usb %s", bkpinfo->media_device);
     863    } else {
     864        mr_asprintf(&tmp2,"");
    865865    }
    866866
     
    14861486    malloc_string(result_str);
    14871487    transfer_block =
    1488         malloc(sizeof(struct s_bkpinfo) + BKPINFO_LOC_OFFSET + 64);
     1488        mr_malloc(sizeof(struct s_bkpinfo) + BKPINFO_LOC_OFFSET + 64);
    14891489    memset((void *) transfer_block, 0,
    14901490           sizeof(struct s_bkpinfo) + BKPINFO_LOC_OFFSET + 64);
  • trunk/mondo/src/common/libmondo-filelist.c

    r1046 r1081  
    455455        mr_asprintf(&strtmp, syscall_sprintf, mr_stresc(file_to_analyze, "`$\\\"", '\\'));
    456456        mr_asprintf(&syscall, "%s 2>> /dev/null", strtmp);
    457         paranoid_free(strtmp);
     457        mr_free(strtmp);
    458458        call_exe_and_pipe_output_to_fd(syscall, pout);
    459459        mr_free(syscall);
     
    766766    }
    767767    // add here
    768     if (!(newnode = (struct s_node *) malloc(sizeof(struct s_node)))) {
    769         log_to_screen(_("failed to malloc"));
    770         depth--;
    771         return (1);
    772     }
     768    newnode = (struct s_node *) mr_malloc(sizeof(struct s_node));
    773769    if (char_to_add < node->ch) // add to the left of node
    774770    {
     
    796792    log_msg(6, "Adding remaining chars ('%s')", string_to_add + 1);
    797793    for (i = 1; i < noof_chars; i++) {
    798         if (!
    799             (node->down =
    800              (struct s_node *) malloc(sizeof(struct s_node)))) {
    801             log_to_screen(_("%s - failed to malloc"), string_to_add);
    802             return (1);
     794            node->down = (struct s_node *) mr_malloc(sizeof(struct s_node));
    803795        }
    804796        node = node->down;
     
    858850    }
    859851    g_original_noof_lines_in_filelist = lines_in_filelist;
    860     if (!(filelist = (struct s_node *) malloc(sizeof(struct s_node)))) {
    861         return (NULL);
    862     }
     852    filelist = (struct s_node *) mr_malloc(sizeof(struct s_node));
    863853    filelist->ch = '/';
    864854    filelist->right = NULL;
    865     filelist->down = malloc(sizeof(struct s_node));
     855    filelist->down = mr_malloc(sizeof(struct s_node));
    866856    filelist->expanded = filelist->selected = FALSE;
    867857    (filelist->down)->ch = '\0';
  • trunk/mondo/src/common/libmondo-fork.c

    r1079 r1081  
    33 */
    44#include "my-stuff.h"
     5#include "mr_mem.h"
    56#include "mondostructures.h"
    67#include "libmondo-fork.h"
     
    7980    assert_string_is_neither_NULL_nor_zerolength(isofile);
    8081    assert_string_is_neither_NULL_nor_zerolength(logstub);
    81     if (!(midway_call = malloc(1200))) {
    82         fatal_error("Cannot malloc midway_call");
    83     }
    84     if (!(ultimate_call = malloc(1200))) {
    85         fatal_error("Cannot malloc ultimate_call");
    86     }
    87     if (!(tmp = malloc(1200))) {
    88         fatal_error("Cannot malloc tmp");
    89     }
     82    midway_call = mr_malloc(1200);
     83    ultimate_call = mr_malloc(1200);
     84    tmp = mr_malloc(1200);
    9085
    9186    mr_asprintf(&cd_number_str, "%d", cd_no);
     
    350345    log_msg(5, "Opening.");
    351346    bufcap = 256L * 1024L;
    352     if (!(buf = malloc(bufcap))) {
    353         fatal_error("Failed to malloc() buf");
    354     }
     347    buf = mr_malloc(bufcap);
    355348
    356349    if (direction == 'w') {
  • trunk/mondo/src/common/libmondo-mountlist.c

    r900 r1081  
    1 /* $Id$
    2 subroutines for handling mountlist
     1/* subroutines for handling mountlist
     2   $Id$
    33*/
    44
     
    1616#include "libmondo-string-EXT.h"
    1717#include "newt-specific-EXT.h"
     18#include "mr_mem.h"
    1819#include "mr_mem.h"
    1920
     
    753754    /*@ initialize ******************************************************* */
    754755
    755     drivelist = malloc(sizeof(struct list_of_disks));
     756    drivelist = mr_malloc(sizeof(struct list_of_disks));
    756757    assert(mountlist != NULL);
    757758
  • trunk/mondo/src/common/libmondo-raid.c

    r1079 r1081  
    1818#include "mr_mem.h"
    1919#include "mr_str.h"
     20#include "mr_mem.h"
    2021
    2122#ifdef __FreeBSD__
     
    817818    int i, j;
    818819    static char **ret;
    819     ret = (char **) malloc(nval * sizeof(char *));
     820    ret = (char **) mr_malloc(nval * sizeof(char *));
    820821    for (i = 0; i < (argc - nval); ++i) {
    821822        if (!strcmp(argv[i], option)) {
    822823            for (j = 0; j < nval; ++j) {
    823                 ret[j] = (char *) malloc(strlen(argv[i + j + 1]) + 1);
     824                ret[j] = (char *) mr_malloc(strlen(argv[i + j + 1]) + 1);
    824825                strcpy(ret[j], argv[i + j + 1]);
    825826            }
     
    11751176    int retval = 0;
    11761177
    1177     raidlist = malloc(sizeof(struct raidlist_itself));
     1178    raidlist = mr_malloc(sizeof(struct raidlist_itself));
    11781179
    11791180    // FIXME: Prefix '/dev/' should really be dynamic!
  • trunk/mondo/src/common/libmondo-stream.c

    r979 r1081  
    1313
    1414#include "my-stuff.h"
     15#include "mr_mem.h"
    1516#include "mondostructures.h"
    1617#include "libmondo-devices.h"
     
    106107    int i;
    107108
    108     blk = (char *) malloc(256 * 1024);
     109    blk = (char *) mr_malloc(256 * 1024);
    109110
    110111    log_it("closein_tape() -- entering");
     
    153154    char *blk;
    154155
    155     blk = (char *) malloc(256 * 1024);
     156    blk = (char *) mr_malloc(256 * 1024);
    156157
    157158    sleep(1);
     
    624625
    625626    assert_string_is_neither_NULL_nor_zerolength(bkpinfo->media_device);
    626     if (!(g_tapecatalog = malloc(sizeof(struct s_tapecatalog)))) {
    627         fatal_error("Cannot alloc mem for tape catalog");
    628     }
     627    g_tapecatalog = mr_malloc(sizeof(struct s_tapecatalog));
    629628    g_tapecatalog->entries = 0;
    630629    g_tape_posK = 0;
     
    658657        return (-1);
    659658    }
    660     if (!(datablock = (char *) malloc(256 * 1024))) {
    661         log_to_screen(_("Unable to malloc 256*1024"));
    662         exit(1);
    663     }
     659    datablock = (char *) mr_malloc(256 * 1024);
    664660    for (i = 0; i < 32; i++) {
    665661        for (j = 0; j < 4; j++) {
     
    726722    /*  initialise the catalog */
    727723    g_current_media_number = 1;
    728     if (!(g_tapecatalog = malloc(sizeof(struct s_tapecatalog)))) {
    729         fatal_error("Cannot alloc mem for tape catalog");
    730     }
     724    g_tapecatalog = mr_malloc(sizeof(struct s_tapecatalog));
    731725    g_tapecatalog->entries = 0;
    732726    /* log stuff */
     
    759753        return (0);
    760754    }
    761     if (!(g_tapecatalog = malloc(sizeof(struct s_tapecatalog)))) {
    762         fatal_error("Cannot alloc mem for tape catalog");
    763     }
     755    g_tapecatalog = mr_malloc(sizeof(struct s_tapecatalog));
    764756    g_tapecatalog->entries = 0;
    765757    g_tape_posK = 0;
     
    872864
    873865    /*@ init  ******************************************************* */
    874     datablock = malloc(TAPE_BLOCK_SIZE);
     866    datablock = mr_malloc(TAPE_BLOCK_SIZE);
    875867    crc16 = 0;
    876868    crctt = 0;
     
    1003995    /*@ end vars *************************************************** */
    1004996
    1005     tempblock = (char *) malloc((size_t) TAPE_BLOCK_SIZE);
     997    tempblock = (char *) mr_malloc((size_t) TAPE_BLOCK_SIZE);
    1006998
    1007999    for (i = 0; i < (int) TAPE_BLOCK_SIZE; i++) {
     
    11421134    long bytes_to_write;
    11431135
    1144     datablock = malloc(TAPE_BLOCK_SIZE);
     1136    datablock = mr_malloc(TAPE_BLOCK_SIZE);
    11451137    pB = strrchr(the_file_I_was_reading, '/');
    11461138    if (pB) {
  • trunk/mondo/src/common/libmondo-string.c

    r900 r1081  
    99
    1010#include "my-stuff.h"
     11#include "mr_mem.h"
    1112#include "mondostructures.h"
    1213#include "libmondo-string.h"
  • trunk/mondo/src/common/libmondo-tools.c

    r1079 r1081  
    99
    1010#include "my-stuff.h"
     11#include "mr_mem.h"
    1112#include "mondostructures.h"
    1213#include "libmondo-tools.h"
  • trunk/mondo/src/common/libmondo-verify.c

    r1079 r1081  
    88
    99#include "my-stuff.h"
     10#include "mr_mem.h"
    1011#include "mondostructures.h"
    1112#include "libmondo-verify.h"
     
    221222
    222223    if (!bufblkA) {
    223         if (!(bufblkA = malloc(maxbufsize))) {
    224             fatal_error("Cannot malloc bufblkA");
    225         }
     224        bufblkA = mr_malloc(maxbufsize);
    226225    }
    227226    if (!bufblkB) {
    228         if (!(bufblkB = malloc(maxbufsize))) {
    229             fatal_error("Cannot malloc bufblkB");
    230         }
     227        bufblkB = mr_malloc(maxbufsize);
    231228    }
    232229
     
    685682    }
    686683    mr_free(biggie_cksum);
    687 
    688684    return (retval);
    689685}
  • trunk/mondo/src/common/newt-specific.c

    r1074 r1081  
    1818
    1919#include "my-stuff.h"
     20#include "mr_mem.h"
    2021#include "mondostructures.h"
    2122#include "newt-specific.h"
     
    869870
    870871        err_log_lines =
    871             (char **) malloc(sizeof(char *) * g_noof_log_lines);
     872            (char **) mr_malloc(sizeof(char *) * g_noof_log_lines);
    872873        if (!err_log_lines) {
    873874            fatal_error("Out of memory");
     
    14911492        }
    14921493
    1493         filelist = (struct s_filelist *) malloc(sizeof(struct s_filelist));
     1494        filelist = (struct s_filelist *) mr_malloc(sizeof(struct s_filelist));
    14941495        fileListbox =
    14951496            newtListbox(2, 2, 12, NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT);
Note: See TracChangeset for help on using the changeset viewer.