Changeset 1940


Ignore:
Timestamp:
May 17, 2008, 2:34:23 AM (11 years ago)
Author:
bruno
Message:

Improve log when errors on ext. attr.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mondo/src/common/libmondo-stream.c

    r1934 r1940  
    448448    int res = 0;
    449449    char *fname = (char *)&res;                 /* Should NOT be NULL */
     450    char *tmp = NULL;
    450451
    451452    // xattr
     
    455456            wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
    456457        }
    457         if (!strstr(fname, "xattr")) {
    458             fatal_error("Wrong order for xattr, sunshine.");
     458        if (strstr(fname, "xattr") == NULL) {
     459            asprintf(&tmp,"Wrong order expected xattr, got %s, sunshine.", fname);
     460            fatal_error(tmp);
    459461        }
    460462        read_file_from_stream_to_file(xattr_fname, *ptmp_size);
    461         res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     463        res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
    462464        if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
    463465            wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr);
    464466        }
    465467        log_msg(1, "Got xattr");
    466         res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     468        res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
    467469        if (*pctrl_chr != BLK_STOP_EXTENDED_ATTRIBUTES) {
    468470            wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr);
    469471        }
    470         res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     472        res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
    471473        if (pctrl_chr == BLK_START_AN_AFIO_OR_SLICE) {
    472474            log_msg(1, "No acl attributes found, skipping to afio files");
     
    481483    if (g_getfacl) {
    482484        res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
    483         if (!strstr(fname, "acl")) {
    484             fatal_error("Wrong order for acl, sunshine.");
    485         }
    486485        if (*pctrl_chr != BLK_START_EXAT_FILE) {
    487486            wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
    488487        }
     488        if (strstr(fname, "acl") == NULL) {
     489            asprintf(&tmp,"Wrong order expected acl, got %s, sunshine.", fname);
     490            fatal_error(tmp);
     491        }
    489492        read_file_from_stream_to_file(acl_fname, *ptmp_size);
    490         res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     493        res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
    491494        if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
    492495            wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr);
    493496        }
    494         res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     497        res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
    495498        if (*pctrl_chr != BLK_STOP_EXTENDED_ATTRIBUTES) {
    496499            wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr);
Note: See TracChangeset for help on using the changeset viewer.