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/common/libmondo-stream.c

    r2376 r2383  
    265265
    266266    mr_asprintf(command, "%s -scanbus 2> /dev/null | grep -i tape | wc -l", cdr_exe);
    267     mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
     267    tmp = call_program_and_get_last_line_of_output(command);
    268268    mr_free(command);
    269269
     
    277277
    278278    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);
    279     mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
     279    tmp = call_program_and_get_last_line_of_output(command);
    280280    mr_free(command);
    281281
     
    289289    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' ' -f3 | cut -d')' -f1 | head -n1", cdr_exe);
    290290    mr_free(cdr_exe);
    291     mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
     291    tmp = call_program_and_get_last_line_of_output(command);
    292292    mr_free(command);
    293293
     
    324324    }
    325325
    326     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;};};};'"));
     326    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;};};};'");
    327327
    328328    if (mt_says_tape_exists(dev)) {
Note: See TracChangeset for help on using the changeset viewer.