Ignore:
Timestamp:
Aug 18, 2009, 3:05:43 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3334@localhost: bruno | 2009-08-08 12:17:37 +0200

  • Change mr_asprintf interface to pass only the char * (makes bkpinfo usage more easy)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-fifo.c

    r2296 r2323  
    8888    for (bufsize = wise_upper_limit, res = -1;
    8989         res != 0 && bufsize >= wise_lower_limit; bufsize--) {
    90         mr_asprintf(&tmp, "dd if=/dev/zero bs=1024 count=16k 2> /dev/null | buffer -o /dev/null -s %ld -m %d%c", internal_tape_block_size, bufsize, 'm');
     90        mr_asprintf(tmp, "dd if=/dev/zero bs=1024 count=16k 2> /dev/null | buffer -o /dev/null -s %ld -m %d%c", internal_tape_block_size, bufsize, 'm');
    9191        res = run_program_and_log_output(tmp, 2);
    9292        mr_free(tmp);
     
    9494    if (!res) {
    9595        bufsize++;
    96         mr_asprintf(&tmp, "Negotiated max buffer of %d MB ", bufsize);
     96        mr_asprintf(tmp, "Negotiated max buffer of %d MB ", bufsize);
    9797        log_to_screen(tmp);
    9898        mr_free(tmp);
     
    118118    }
    119119    log_msg(2, "Calling buffer --- command = '%s'", g_sz_call_to_buffer);
    120     mr_asprintf(&sz_dir, "%c", direction);
     120    mr_asprintf(sz_dir, "%c", direction);
    121121    fres = popen(g_sz_call_to_buffer, sz_dir);
    122122    mr_free(sz_dir);
     
    130130    }
    131131    sleep(2);
    132     mr_asprintf(&tmp, "ps %s | grep \"%s\"", ps_options, g_sz_call_to_buffer);
     132    mr_asprintf(tmp, "ps %s | grep \"%s\"", ps_options, g_sz_call_to_buffer);
    133133    if (run_program_and_log_output(tmp, 2)) {
    134134        log_msg(2, "Warning - I think I failed to open tape, actually.");
     
    136136    mr_free(tmp);
    137137    g_tape_buffer_size_MB = bufsize;
    138     mr_asprintf(&command, "ps %s | grep buffer | grep -v grep", ps_options);
     138    mr_asprintf(command, "ps %s | grep buffer | grep -v grep", ps_options);
    139139    if (run_program_and_log_output(command, 1)) {
    140140        fres = NULL;
     
    165165    }
    166166    paranoid_system("sync");
    167     mr_asprintf(&command, "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer);
     167    mr_asprintf(command, "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer);
    168168    log_msg(2, "kill_buffer() --- command = %s", command);
    169     mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output(command));
     169    mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
    170170    mr_free(command);
    171171
    172     mr_asprintf(&command, "kill %s", tmp);
     172    mr_asprintf(command, "kill %s", tmp);
    173173    log_msg(2, "kill_buffer() --- command = %s", command);
    174174    if (strlen(tmp) > 0) {
Note: See TracChangeset for help on using the changeset viewer.