Ignore:
Timestamp:
Feb 16, 2007, 2:16:14 PM (12 years ago)
Author:
bruno
Message:

Some merges from stable (synchro for mem. mngt)

File:
1 edited

Legend:

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

    r1086 r1176  
    1414#include "my-stuff.h"
    1515#include "mr_mem.h"
     16#include "mr_msg.h"
     17
    1618#include "mondostructures.h"
    1719#include "libmondo-devices.h"
     
    2325#include "libmondo-tools-EXT.h"
    2426#include "libmondo-fifo-EXT.h"
    25 #include "mr_mem.h"
    2627
    2728#define EXTRA_TAPE_CHECKSUMS
    2829
     30/*@unused@*/
     31//static char cvsid[] = "$Id$";
    2932extern bool g_sigpipe;
    3033extern int g_tape_buffer_size_MB;
     
    132135    }
    133136    mr_free(blk);
    134     mr_free((void *)g_tapecatalog);
     137    mr_free(g_tapecatalog);
    135138    return (retval);
    136139}
     
    151154
    152155    /*@ long long's ************************************************* */
    153     int i;
    154     char *blk;
     156    int i = 0;
     157    char *blk = NULL;
    155158
    156159    blk = (char *) mr_malloc(256 * 1024);
     
    186189    }
    187190    mr_free(blk);
    188     mr_free((void *)g_tapecatalog);
     191    mr_free(g_tapecatalog);
    189192    return (retval);
    190193}
     
    251254
    252255    mr_asprintf(&command,
    253              "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1",
    254              cdr_exe);
     256            "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1",
     257            cdr_exe);
    255258    tmp = call_program_and_get_last_line_of_output(command);
    256259    mr_free(command);
     
    264267
    265268    mr_asprintf(&command,
    266              "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1",
    267              cdr_exe);
     269            "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1",
     270            cdr_exe);
    268271    mr_free(cdr_exe);
    269272
     
    339342    }
    340343}
     344
    341345
    342346int read_EXAT_files_from_tape(struct s_bkpinfo *bkpinfo,
     
    450454{
    451455    int i;
    452     char *tmp;
     456    char *tmp = NULL;
    453457
    454458    log_it("Insisting on tape #%d", tapeno);
     
    488492
    489493
    490 
    491 
    492494/**
    493495 * Add a file to a collection of recently archived filesets/slices.
     
    507509    int last, curr, i;
    508510    t_archtype type = other;
    509     char *command;
    510     char *tmpdir;
    511     char *old_fname;
     511    char *command = NULL;
     512    char *tmpdir = NULL;
     513    char *old_fname = NULL;
    512514
    513515    bufsize_K = (long long) (1024LL * (1 + g_tape_buffer_size_MB));
    514     mr_asprintf(&tmpdir, "%s/tmpfs/backcatalog", td);
    515516    if (strstr(latest_fname, ".afio.") || strstr(latest_fname, ".star.")) {
    516517        type = fileset;
     
    522523            ("Unknown type. Internal error in maintain_collection_of_recent_archives()");
    523524    }
     525
     526    mr_asprintf(&tmpdir, "%s/tmpfs/backcatalog", td);
    524527    mkdir(tmpdir, 0x700);
    525528    mr_asprintf(&command, "cp -f %s %s", latest_fname, tmpdir);
     
    603606{
    604607    /*@ buffer ***************************************************** */
    605     char *datablock;
    606     char *tmp;
     608    char *datablock = NULL;
     609    char *tmp = NULL;
    607610    char old_cwd[MAX_STR_LEN];
    608     char *outfname;
     611    char *outfname = NULL;
    609612    /*@ int ******************************************************* */
    610613    int i;
     
    649652    log_to_screen(_("Reading stream"));
    650653    log_it("stream device = '%s'", bkpinfo->media_device);
    651 /* skip data disks */
     654    /* skip data disks */
    652655    open_evalcall_form("Skipping data disks on stream");
    653656    log_to_screen(_("Skipping data disks on stream"));
     
    712715{
    713716    /*@ buffers ***************************************************** */
    714     char *command;
     717    char *command = NULL;
    715718
    716719    /*@ end vars *************************************************** */
     
    832835{
    833836    /*@ buffers ***************************************************** */
    834     char *tmp;
    835     char *datablock;
     837    char *tmp = NULL;
     838    char *datablock = NULL;
    836839    char *temp_fname = (char *)bkpinfo; /* Should NOT be NULL */
    837840    char *temp_cksum = (char *)bkpinfo; /* Should NOT be NULL */
    838     char *actual_cksum;
     841    char *actual_cksum = NULL;
    839842
    840843    /*@ int ********************************************************* */
     
    12891292{
    12901293    int res = 0;
    1291     char *command;
     1294    char *command = NULL;
    12921295
    12931296    paranoid_pclose(g_tape_stream);
     
    13481351{
    13491352    int i, last, res = 0;
    1350     char *fname;
     1353    char *fname = NULL;
    13511354
    13521355    mr_msg(2, "I am now writing back catalog to tape");
     
    13871390{
    13881391    /*@ pointers *************************************************** */
    1389     FILE *fin;
    1390     char *tmp;
     1392    FILE *fin = NULL;
     1393    char *tmp = NULL;
    13911394
    13921395    /*@ long ******************************************************* */
     
    14491452{
    14501453    /*@ buffers **************************************************** */
    1451     char *tmp;
     1454    char *tmp = NULL;
    14521455    char datablock[TAPE_BLOCK_SIZE];
    1453     char *checksum;
    1454     char *infile_basename;
     1456    char *checksum = NULL;
     1457    char *infile_basename = NULL;
    14551458
    14561459    /*@ int ******************************************************** */
     
    15701573    /*@ buffers **************************************************** */
    15711574    char tempblock[TAPE_BLOCK_SIZE];
    1572     char *tmp;
    15731575    char *p;
    15741576
     
    16031605        fwrite(tempblock, 1, (size_t) TAPE_BLOCK_SIZE,
    16041606               g_tape_stream) / 1024;
    1605     mr_asprintf(&tmp, "%s (fname=%s, size=%ld K)",
    1606              marker_to_string(control_char), p,
    1607              (long) length_of_incoming_file >> 10);
    1608     mr_msg(6, tmp);
    1609     mr_free(tmp);
     1607    mr_msg(6, "%s (fname=%s, size=%ld K)",
     1608            marker_to_string(control_char), p,
     1609            (long) length_of_incoming_file >> 10);
    16101610    return (0);
    16111611}
     
    16201620{
    16211621    /*@ buffer ***************************************************** */
    1622     char *tmp;
     1622    char *tmp = NULL;
    16231623
    16241624
Note: See TracChangeset for help on using the changeset viewer.