Changeset 1571


Ignore:
Timestamp:
Jul 26, 2007, 2:12:40 AM (12 years ago)
Author:
bruno
Message:
  • Improve mr_conf functions loging with conf file filename printed
  • MINDI_CONF_DIR depends on MONDO_CONF_DIR (just a bit better)
Location:
branches/stable/mondo/src
Files:
3 edited

Legend:

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

    r1570 r1571  
    18911891        mr_asprintf(&message_to_screen, "Running %s to make %s #%d",
    18921892                mr_conf->iso_creation_cmd,
    1893                  bkpinfo->backup_media_string,
    1894                  g_current_media_number);
     1893                bkpinfo->backup_media_string,
     1894                g_current_media_number);
    18951895        mr_msg(1, message_to_screen);
    18961896        mr_asprintf(&result_sz, "Call to %s to make ISO (%s #%d) ",
    18971897                mr_conf->iso_creation_cmd,
    1898                  bkpinfo->backup_media_string,
    1899                  g_current_media_number);
     1898                bkpinfo->backup_media_string,
     1899                g_current_media_number);
    19001900        if (bkpinfo->nonbootable_backup) {
    19011901            mr_msg(1, "Making nonbootable backup");
  • branches/stable/mondo/src/lib/mr_conf.c

    r1559 r1571  
    8080static int internal_flags = 0;  /*state of the module */
    8181static FILE *CONF = NULL;       /* Configuration file FD */
     82static char *mr_conf_filename = NULL;   /* Configuration filename */
    8283
    8384/*if output all error and warning messages*/
     
    108109    CONF = fopen(filename, "r");
    109110
     111    mr_asprintf(&mr_conf_filename,filename);
     112
    110113    /*if file is empty or not exist => error */
    111114    if (length == 0) {
     
    146149    mr_free(buffer);
    147150    fclose(CONF);
     151
     152    mr_free(mr_conf_filename);
    148153
    149154    /*set flag that module is in "close" state */
     
    389394        switch (error_code) {
    390395        case MRCONF_BAD_FILE:
    391             mr_msg_int(1,line,file,"%s %s %s", MRCONF_STR_ERROR, MRCONF_STR_BAD_FILE,
     396            mr_msg_int(1,line,file,"%s (%s) %s %s", MRCONF_STR_ERROR, mr_conf_filename, MRCONF_STR_BAD_FILE,
    392397                   add_line);
    393398            break;
    394399
    395400        case MRCONF_READING_FAILED:
    396             mr_msg_int(1,line,file,"%s %s", MRCONF_STR_ERROR, MRCONF_STR_READING_FAILED);
     401            mr_msg_int(1,line,file,"%s (%s) %s", MRCONF_STR_ERROR, mr_conf_filename, MRCONF_STR_READING_FAILED);
    397402            break;
    398403
    399404        case MRCONF_FIELD_NOT_FOUND:
    400             mr_msg_int(1,line,file,"%s %s \"%s\"", MRCONF_STR_ERROR, MRCONF_STR_FIELD_NOT_FOUND, add_line);
    401             mr_msg_int(1,line,file,"%s %s", MRCONF_STR_WARNING, MRCONF_STR_SET_TO_ZERO);
     405            mr_msg_int(1,line,file,"%s (%s) %s \"%s\"", MRCONF_STR_ERROR, mr_conf_filename, MRCONF_STR_FIELD_NOT_FOUND, add_line);
     406            mr_msg_int(1,line,file,"%s (%s) %s", MRCONF_STR_WARNING, mr_conf_filename, MRCONF_STR_SET_TO_ZERO);
    402407            break;
    403408
    404409        case MRCONF_FIELD_NO_VALUE:
    405             mr_msg_int(1,line,file,"%s %s \"%s\"", MRCONF_STR_ERROR, MRCONF_STR_FIELD_NO_VALUE, add_line);
    406             mr_msg_int(1,line,file,"%s %s", MRCONF_STR_WARNING, MRCONF_STR_IGNORE);
     410            mr_msg_int(1,line,file,"%s (%s) %s \"%s\"", MRCONF_STR_ERROR, mr_conf_filename, MRCONF_STR_FIELD_NO_VALUE, add_line);
     411            mr_msg_int(1,line,file,"%s (%s) %s", MRCONF_STR_WARNING, mr_conf_filename, MRCONF_STR_IGNORE);
    407412            break;
    408413
    409414        case MRCONF_CLOSE_BUT_NOT_OPEN:
    410             mr_msg_int(1,line,file,"%s %s", MRCONF_STR_WARNING, MRCONF_STR_CLOSE_BUT_NOT_OPEN);
     415            mr_msg_int(1,line,file,"%s (%s) %s", MRCONF_STR_WARNING, mr_conf_filename, MRCONF_STR_CLOSE_BUT_NOT_OPEN);
    411416            break;
    412417
    413418        case MRCONF_CALL_BUT_NOT_OPEN:
    414             mr_msg_int(1,line,file,"%s %s", MRCONF_STR_WARNING, MRCONF_STR_CALL_BUT_NOT_OPEN);
     419            mr_msg_int(1,line,file,"%s (%s) %s", MRCONF_STR_WARNING, mr_conf_filename, MRCONF_STR_CALL_BUT_NOT_OPEN);
    415420            break;
    416421
    417422        case MRCONF_OPEN_OPENED:
    418             mr_msg_int(1,line,file,"%s %s", MRCONF_STR_ERROR, MRCONF_STR_OPEN_OPENED);
     423            mr_msg_int(1,line,file,"%s (%s) %s", MRCONF_STR_ERROR, mr_conf_filename, MRCONF_STR_OPEN_OPENED);
    419424            break;
    420425
    421426        case MRCONF_STRING_QUOTE:
    422             mr_msg_int(1,line,file,"%s %s", MRCONF_STR_ERROR, MRCONF_STR_STRING_QUOTE);
     427            mr_msg_int(1,line,file,"%s (%s) %s", MRCONF_STR_ERROR, mr_conf_filename, MRCONF_STR_STRING_QUOTE);
    423428            break;
    424429
    425430        case MRCONF_STRING_ENDQUOTE:
    426             mr_msg_int(1,line,file,"%s %s", MRCONF_STR_ERROR, MRCONF_STR_STRING_ENDQUOTE);
     431            mr_msg_int(1,line,file,"%s (%s) %s", MRCONF_STR_ERROR, mr_conf_filename, MRCONF_STR_STRING_ENDQUOTE);
    427432            break;
    428433
    429434        default:
    430             mr_msg_int(1,line,file,"%s %s", MRCONF_STR_ERROR, MRCONF_STR_DEFAULT_ERROR);
    431             break;
    432         }
    433     }
    434 }
     435            mr_msg_int(1,line,file,"%s (%s) %s", MRCONF_STR_ERROR, mr_conf_filename, MRCONF_STR_DEFAULT_ERROR);
     436            break;
     437        }
     438    }
     439}
  • branches/stable/mondo/src/mondoarchive/mondoarchive.c

    r1554 r1571  
    344344    /* Get content of mindi conf file now to finish structure initialization */
    345345/* Tempo Hack */
    346 #define MINDI_CONF_DIR "/etc/mindi"
     346#define MINDI_CONF_DIR MONDO_CONF_DIR"/../mindi"
    347347    if (mr_conf_open(MINDI_CONF_DIR"/mindi.conf.dist") != 0) {
    348348            mr_log_exit(-1, "Unable to open "MINDI_CONF_DIR"/mindi.conf.dist");
Note: See TracChangeset for help on using the changeset viewer.