Ignore:
Timestamp:
Nov 5, 2016, 6:12:23 PM (7 years ago)
Author:
Bruno Cornec
Message:
  • Change interfaces for the call_program_and_get_last_line_of_output and where_is_root_mounted(now return dynamically allocated string)
  • removes useless function store_netfs_config
File:
1 edited

Legend:

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

    r3381 r3610  
    861861    mr_asprintf(tmp1, "zcat %s | wc -l", filelist_fname);
    862862    log_msg(6, "tmp1 = %s", tmp1);
    863     lines_in_filelist = atol(call_program_and_get_last_line_of_output(tmp1));
     863    tmp = call_program_and_get_last_line_of_output(tmp1);
     864    lines_in_filelist = atol(tmp);
     865    mr_free(tmp);
    864866    mr_free(tmp1);
    865867
     
    13021304    char *new = NULL;
    13031305    char *tmp = NULL;
     1306    char *tmp2 = NULL;
    13041307    char *dir = NULL;
    13051308    static int percentage = 0;
     
    13581361
    13591362        mr_asprintf(tmp, "wc -l %s | awk '{print $1;}'", g_skeleton_filelist);
    1360         g_skeleton_entries = 1 + atol(call_program_and_get_last_line_of_output(tmp));
     1363        tmp2 = call_program_and_get_last_line_of_output(tmp);
     1364        g_skeleton_entries = 1 + atol(tmp2);
     1365        mr_free(tmp2);
    13611366        mr_free(tmp);
    13621367
     
    15231528        }
    15241529        make_hole_for_file(sz_datefile);
    1525         write_one_liner_data_file(sz_datefile,
    1526                                   call_program_and_get_last_line_of_output
    1527                                   ("date +%s"));
     1530        tmp2 = call_program_and_get_last_line_of_output("date +%s");
     1531        write_one_liner_data_file(sz_datefile, tmp2);
     1532        mr_free(tmp2);
    15281533    } else if (lstat(sz_datefile, &statbuf)) {
    15291534        log_msg(2, "Warning - unable to find date of previous backup. Full backup instead.");
     
    15501555        }
    15511556        log_msg(1, "Calculating filelist");
    1552         mr_asprintf(tmp2, "%s", call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|ntfs-3g|fat|vfat|dos' | awk '{print $3}'"));
     1557        tmp2 = call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|ntfs-3g|fat|vfat|dos' | awk '{print $3}'");
    15531558        if (strlen(tmp2) < 1) {
    15541559            mr_asprintf(tmp1," ");
     
    15571562            mr_asprintf(tmp1, "find %s -name '/win386.swp' -o -name '/hiberfil.sys' -o -name '/pagefile.sys' 2> /dev/null\n",tmp2);
    15581563            mr_free(tmp2);
    1559             mr_asprintf(tmp2, "%s", call_program_and_get_last_line_of_output(tmp1));
     1564            tmp2 = call_program_and_get_last_line_of_output(tmp1);
    15601565            log_msg(2, "Found windows files: %s",tmp2);
    15611566        }
Note: See TracChangeset for help on using the changeset viewer.