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-stream.c

    r3527 r3610  
    256256int find_tape_device_and_size(char *dev, char *siz)
    257257{
    258     char tmp[MAX_STR_LEN];
     258    char *tmp = NULL;
    259259    char *command = NULL;
    260260    char *cdr_exe = NULL;
     
    269269    }
    270270    mr_asprintf(command, "%s -scanbus 2> /dev/null | grep -i tape | wc -l", cdr_exe);
    271     mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
     271    tmp = call_program_and_get_last_line_of_output(command);
    272272    mr_free(command);
    273273
     
    282282
    283283    mr_asprintf(command, "%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", cdr_exe);
    284     mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
     284    tmp = call_program_and_get_last_line_of_output(command);
    285285    mr_free(command);
    286286
     
    294294    mr_free(cdr_exe);
    295295
    296     mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
     296    tmp = call_program_and_get_last_line_of_output(command);
    297297    mr_free(command);
    298298
     
    326326    }
    327327
    328     mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | awk '{for(i=1; i<NF; i++) { if (index($i, \"GB\")>0) { print $i;};};};'"));
     328    tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | awk '{for(i=1; i<NF; i++) { if (index($i, \"GB\")>0) { print $i;};};};'");
    329329
    330330    if (mt_says_tape_exists(dev)) {
Note: See TracChangeset for help on using the changeset viewer.