Ignore:
Timestamp:
Jun 19, 2013, 8:34:46 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • First pass on svn merge -r 2935:3146 ../3.0
File:
1 edited

Legend:

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

    r2937 r3147  
    3030
    3131extern char *MONDO_LOGFILE;
     32
     33extern long g_max_biggie_size;
    3234
    3335/* Reference to global bkpinfo */
     
    195197/*@ long ****************************************/
    196198    long lino = 0;
    197     long max_sane_size_for_a_file;
     199    // A big file has more than 64 MB of real content
    198200    long curr_set_size;
    199201    long noof_lines;
     
    221223    assert_string_is_neither_NULL_nor_zerolength(filelist);
    222224    assert(maxsetsizeK > 0);
    223 
    224     max_sane_size_for_a_file = 64L * 1024L;
    225 // max_sane_size_for_a_file = maxsetsizeK*2;
    226 //  if (max_sane_size_for_a_file > 32*1024)
    227 //    { max_sane_size_for_a_file = 32*1024; }
    228225
    229226    log_it("filelist=%s;", filelist);
     
    269266            siz = 0;
    270267        } else {
    271             siz = (long) (buf.st_size >> 10);
    272         }
    273         if (siz > max_sane_size_for_a_file) {
    274             log_msg(10, "Adding %s to big files\n", incoming);
     268            // blocks are 512 bytes long - cf man 2 stat - Pass to the previous unit (MB => kB e.g.)
     269            // use blocks instead of size to allow sparse file correct handling as much as possible
     270            siz = (long) ((buf.st_blocks*512) >> 10);
     271        }
     272        if (siz > g_max_biggie_size) {
     273            log_msg(10, "Adding %s to big files (size = %ld)\n", incoming, siz);
    275274            fprintf(fbig, "%s\n", incoming);
    276275        } else {
    277276            curr_set_size += siz;
    278             log_msg(10, "Adding %s to filelist %d\n", incoming, curr_set_no);
     277            log_msg(10, "Adding %s to filelist %d (size = %ld)\n", incoming, curr_set_no, siz);
    279278            fprintf(fout, "%s\n", incoming);
    280279            if (curr_set_size > maxsetsizeK) {
     
    400399    char *tmp = NULL;
    401400
     401    char *p;
     402
    402403    pattr = popen(syscall, "r");
    403404    if (!pattr) {
     
    431432    char *strtmp = NULL;
    432433    char *tmp = NULL;
     434    char *p = NULL;
    433435    int i;
    434436
     
    517519    int retval = 0;
    518520    int i;
    519     char *p, *q;
     521    char *p, *q, *r;
    520522    char *tmp = NULL;
    521523    FILE *pin, *pout, *faclin;
     
    13231325    char *skip_these = NULL;
    13241326    char *new_with_pipe;
    1325     char *strtmp;
    1326     char *token;
     1327    char *strtmp = NULL;
     1328    char *token = NULL;
    13271329    char *find_excludes = NULL;
    13281330    char *name_of_evalcall_form = NULL;
     
    13741376
    13751377        log_msg(5, "find command = %s", strtmp);
    1376         (void)system(strtmp);
     1378        paranoid_system(strtmp);
    13771379        mr_free(strtmp);
    13781380
     
    15101512    char *sz_filelist;
    15111513    char *exclude_paths = NULL;
    1512     int i;
    15131514    FILE *fout;
    15141515    char *command = NULL;
     
    15971598            fatal_error("Cannot openout to sz_filelist");
    15981599        }
    1599         i = 0;
    16001600        if ((!include_paths) || (strlen(include_paths) == 0)) {
    16011601            log_msg(1, "Including only '/' in %s", sz_filelist);
     
    16971697{
    16981698    /*@ int ******************************************************** */
    1699     int noof_chars;
    17001699    static int depth = 0;
    17011700    static char original_string[MAX_STR_LEN];
     
    17151714    assert(startnode != NULL);
    17161715    assert(string_to_find != NULL);
    1717 
    1718     noof_chars = strlen(string_to_find) + 1;    /* we include the '\0' */
    17191716
    17201717    log_msg(7, "starting --- str=%s", string_to_find);
Note: See TracChangeset for help on using the changeset viewer.