Ignore:
Timestamp:
Jul 17, 2006, 3:44:46 PM (13 years ago)
Author:
bcornec
Message:

Huge memory management patch.
Still not finished but a lot as been done.
What remains is around some functions returning strings, and some structure members.
(Could not finish due to laptop failure !)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/mondoarchive/mondo-cli.c

    r687 r688  
    1414#include <pthread.h>
    1515#endif
    16 
    17 //static char cvsid[] = "$Id$";
    1816
    1917extern int g_loglevel;
     
    119117    }
    120118//    }
    121     asprintf(&tmp, "rm -Rf %s/tmp.mondo.*", bkpinfo->tmpdir);
     119    asprintf(&tmp, "rm -Rf %s/mondo.tmp.*", bkpinfo->tmpdir);
    122120    paranoid_system(tmp);
    123121    paranoid_free(tmp);
     
    127125    paranoid_free(tmp);
    128126
    129     sprintf(bkpinfo->tmpdir + strlen(bkpinfo->tmpdir), "/tmp.mondo.%ld",
     127    /* BERLIOS : Useless ???
     128    s-printf(bkpinfo->tmpdir + strlen(bkpinfo->tmpdir), "/mondo.tmp.%ld",
    130129            random() % 32767);
    131     sprintf(bkpinfo->scratchdir + strlen(bkpinfo->scratchdir),
     130    s-printf(bkpinfo->scratchdir + strlen(bkpinfo->scratchdir),
    132131            "/mondo.scratch.%ld", random() % 32767);
     132    */
    133133
    134134    asprintf(&tmp, "mkdir -p %s/tmpfs", bkpinfo->tmpdir);
     
    211211    /*@ ints *** */
    212212    int i = 0;
     213    int j = 0;
    213214    int retval = 0;
    214215    int percent = 0;
     
    216217    /*@ buffers ** */
    217218    char *tmp;
    218     char *tmp2;
    219219    char *tmp1;
    220220    char *psz;
     
    495495        asprintf(&tmp, "mount | grep -x \"%s .*\" | cut -d' ' -f3",
    496496                bkpinfo->nfs_mount);
    497         asprintf(&tmp2, call_program_and_get_last_line_of_output(tmp));
    498         bkpinfo->isodir = tmp2;
     497        bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp);
    499498        paranoid_free(tmp);
    500499
     
    683682            if (popup_and_get_string
    684683                (_("Device"), _("Please specify the device"),
    685                  bkpinfo->media_device, MAX_STR_LEN / 4)) {
     684                 bkpinfo->media_device)) {
    686685                retval++;
    687686                log_to_screen(_("User opted to cancel."));
     
    711710        }                       /* not '\0' but '0' */
    712711    }
     712    j = (int) random() % 32768;
    713713    if (flag_set['S']) {
    714         asprintf(&tmp, "%s/mondo.scratch.%ld", flag_val['S'],
    715                 random() % 32768);
     714        asprintf(&tmp, "%s/mondo.scratch.%ld", flag_val['S'], j);
     715        paranoid_free(bkpinfo->scratchdir);
    716716        bkpinfo->scratchdir = tmp;
    717717    }
    718718    if (flag_set['T']) {
    719         asprintf(&tmp, "%s/tmp.mondo.%ld", flag_val['T'],
    720                 random() % 32768);
     719        asprintf(&tmp, "%s/mondo.tmp.%ld", flag_val['T'], j);
     720        paranoid_free(bkpinfo->tmpdir);
    721721        bkpinfo->tmpdir = tmp;
    722722        asprintf(&tmp, "touch %s/.foo.dat", flag_val['T']);
     
    766766            (BOOT_LOADER_CHARS,
    767767             (bkpinfo->boot_loader = flag_val['l'][0]))) {
    768             log_msg(1, "%c? WTF is %c? I need G, L, E or R.",
     768            log_msg(1, "%c? What is %c? I need G, L, E or R.",
    769769                    bkpinfo->boot_loader, bkpinfo->boot_loader);
    770770            fatal_error
Note: See TracChangeset for help on using the changeset viewer.