Ignore:
Timestamp:
Sep 10, 2009, 2:55:51 AM (15 years ago)
Author:
Bruno Cornec
Message:

call_program_and_get_last_line_of_output is now allocating memory and returning that string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondo-prep.c

    r2376 r2383  
    336336            if (lvmversion == 2) {
    337337                mr_asprintf(tmp1, "tail -n5 %s | grep Insufficient | tail -n1", MONDO_LOGFILE);
    338                 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(tmp1));
     338                tmp = call_program_and_get_last_line_of_output(tmp1);
    339339                mr_free(tmp1);
    340340            } else {
    341341                mr_asprintf(tmp1, "tail -n5 %s | grep lvcreate | tail -n1", MONDO_LOGFILE);
    342                 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(tmp1));
     342                tmp = call_program_and_get_last_line_of_output(tmp1);
    343343                mr_free(tmp1);
    344344            }
     
    14141414    char *format = NULL;
    14151415    char *tmp = NULL;
     1416    char *tmp1 = NULL;
    14161417
    14171418    /** end *************************************************************/
     
    15781579    if (pout_to_fdisk) {
    15791580        // mark relevant partition as bootable
    1580         mr_asprintf(tmp, "a\n%s\n", call_program_and_get_last_line_of_output ("make-me-bootable /tmp/mountlist.txt dummy"));
     1581        tmp1 = call_program_and_get_last_line_of_output ("make-me-bootable /tmp/mountlist.txt dummy");
     1582        mr_asprintf(tmp, "a\n%s\n", tmp1);
     1583        mr_free(tmp1);
     1584
    15811585        fput_string_one_char_at_a_time(pout_to_fdisk, tmp);
    15821586        mr_free(tmp);
Note: See TracChangeset for help on using the changeset viewer.