Changeset 1157


Ignore:
Timestamp:
Feb 13, 2007, 2:18:42 AM (13 years ago)
Author:
bruno
Message:

2 more files merged from trunk (pass 1)

Location:
branches/stable/mondo/src/common
Files:
2 edited

Legend:

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

    r1123 r1157  
    159159void kill_buffer()
    160160{
    161     char *tmp;
    162     char *command;
    163 
    164     malloc_string(tmp);
     161    char *tmp = NULL;
     162    char *command = NULL;
     163
    165164    sync();
    166165    if (g_sz_call_to_buffer == NULL) {
     
    173172            "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer);
    174173    mr_msg(2, "kill_buffer() --- command = %s", command);
    175     strcpy(tmp, call_program_and_get_last_line_of_output(command));
     174    mr_asprintf(&tmp, call_program_and_get_last_line_of_output(command));
    176175    mr_free(command);
    177176
  • branches/stable/mondo/src/common/libmondo-filelist.c

    r1123 r1157  
    3636
    3737
    38 extern ssize_t getline(char **lineptr, size_t * n, FILE * stream);
    39 
    40 
    4138int mondo_makefilelist(char *logfile, char *tmpdir, char *scratchdir,
    4239                       char *include_paths, char *excp, int differential,
     
    227224    /*@ structures ********************************* */
    228225    struct stat buf;
    229     int err = 0;
    230 
    231226
    232227    assert_string_is_neither_NULL_nor_zerolength(filelist);
     
    253248    if (!(fbig = fopen(biggie_fname, "w"))) {
    254249        log_OS_error("Cannot openout biggie_fname");
    255         err++;
    256         goto end_of_func;
     250        return (0);
    257251    }
    258252    if (!(fout = fopen(outfname, "w"))) {
    259253        log_OS_error("Cannot openout outfname");
    260         err++;
    261         goto end_of_func;
     254        return (0);
    262255    }
    263256    mr_getline(&incoming, &n, fin);
     
    296289                if (!(fout = fopen(outfname, "w"))) {
    297290                    log_OS_error("Unable to openout outfname");
    298                     err++;
    299                     goto end_of_func;
     291                    return (0);
    300292                }
    301293                update_evalcall_form((int) (lino * 100 / noof_lines));
     
    323315        log_OS_error
    324316            ("Unable to echo write one-liner to LAST-FILELIST-NUMBER");
    325         err = 1;
     317        return (0);
    326318    }
    327319    mr_free(outfname);
     
    340332       then update_progress_form() won't show the "time taken / time remaining"
    341333       line. The bug only crops up AFTER the call to chop_filelist(). Weird. */
    342 #ifndef _XWIN
    343334    if (!g_text_mode) {
    344335        open_progress_form("", "", "", "", 100);
     
    347338        newtPopWindow();
    348339    }
    349 #endif
    350   end_of_func:
    351     return (err ? 0 : curr_set_no + 1);
     340    return (curr_set_no + 1);
    352341}
    353342
     
    13331322        malloc_string(name_of_evalcall_form);
    13341323        malloc_string(find_skeleton_marker);
    1335         asprintf(&find_excludes, " ");
     1324        mr_asprintf(&find_excludes, " ");
    13361325        while((token = mr_strtok (sth, delims, &lastpos))) {
    1337           asprintf(&strtmp,"%s", find_excludes);
     1326          mr_asprintf(&strtmp,"%s", find_excludes);
    13381327          mr_free(find_excludes);
    1339           asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token);
     1328          mr_asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token);
    13401329          mr_free(strtmp);
    13411330          mr_free(token);
     
    13431332#if linux
    13441333        // 2.6 has /sys as a proc-type thing -- must be excluded
    1345         asprintf(&strtmp,
     1334        mr_asprintf(&strtmp,
    13461335             "find %s -maxdepth %d -fstype mvfs -prune -o -path /dev/shm -prune -o %s -type d -print > %s 2> /dev/null",
    13471336             dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);
    13481337#else
    13491338        // On BSD, for example, /sys is the kernel sources -- don't exclude
    1350         asprintf(&strtmp,
     1339        mr_asprintf(&strtmp,
    13511340             "find %s -maxdepth %d -fstype mvfs -prune -o -path /proc -prune -o %s -type d -print > %s 2> /dev/null",
    13521341                dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);
Note: See TracChangeset for help on using the changeset viewer.