Changeset 1135


Ignore:
Timestamp:
Feb 11, 2007, 12:37:42 PM (12 years ago)
Author:
bruno
Message:

mr_file has to use mr_msg_int
merges trunk content of libmondo-archive.c

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

Legend:

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

    r1123 r1135  
    11151115        mr_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),
    11161116                this_thread_no, archiving_set_no);
    1117         res =
    1118             archive_this_fileset(bkpinfo, archiving_filelist_fname,
     1117        res = archive_this_fileset(bkpinfo, archiving_filelist_fname,
    11191118                                 archiving_afioball_fname,
    11201119                                 archiving_set_no);
     
    14861485    char *storing_filelist_fname;
    14871486    char *storing_afioball_fname;
    1488     char *tmp;
     1487    char *tmp = NULL;
    14891488    char *media_usage_comment;
    14901489    pthread_t archival_thread[ARCH_THREADS];
     
    15011500    mr_msg(8, "here");
    15021501    assert(bkpinfo != NULL);
    1503     tmp = mr_malloc(MAX_STR_LEN * 2);
     1502    /* BERLIOS: To be removed */
    15041503    malloc_string(result_str);
    15051504    malloc_string(curr_xattr_list_fname);
     
    15231522    *p_last_set_archived = -1;
    15241523    *p_next_set_to_archive = 0;
    1525     sprintf(tmp, "%s/archives/filelist.full", bkpinfo->scratchdir);
    15261524    log_to_screen("Archiving regular files");
    15271525    mr_msg(5, "Go, Shorty. It's your birthday.");
     
    16411639            update_progress_form(media_usage_comment);
    16421640            if (res) {
    1643                 sprintf(tmp,
    1644                         "Failed to add archive %ld's files to CD dir\n",
    1645                         storing_set_no);
     1641                mr_asprintf(&tmp,
     1642                         "Failed to add archive %ld's files to CD dir\n",
     1643                         storing_set_no);
    16461644                log_to_screen(tmp);
     1645                mr_free(tmp);
    16471646                fatal_error
    16481647                    ("Is your hard disk full? If not, please send the author the logfile.");
     
    16541653    close_progress_form();
    16551654
    1656     sprintf(tmp, "Your regular files have been archived ");
    16571655    mr_msg(2, "Joining background threads to foreground thread");
    16581656    for (i = 0; i < noof_threads; i++) {
     
    16631661    mr_msg(2, "Done.");
    16641662    if (retval) {
    1665         strcat(tmp, "(with errors).");
    1666     } else {
    1667         strcat(tmp, "successfully.");
     1663        mr_asprintf(&tmp,
     1664                 "Your regular files have been archived (with errors).");
     1665    } else {
     1666        mr_asprintf(&tmp,
     1667                 "Your regular files have been archived successfully");
    16681668    }
    16691669    log_to_screen(tmp);
     1670    mr_free(tmp);
    16701671    mr_free(transfer_block);
    16711672    mr_free(result_str);
  • branches/stable/mondo/src/lib/mr_file.c

    r1133 r1135  
    2323
    2424    if ((fd = fopen(path, mode)) == NULL) {
    25         mr_msg(1,line,file,"Unable to open %s",path);
     25        mr_msg_int(1,line,file,"Unable to open %s",path);
    2626        mr_exit(-1,"Exiting");
    2727    }
     
    3434
    3535    if (fd == NULL) {
    36         mr_msg(1,line,file,"fd is NULL.\nShould NOT happen.");
     36        mr_msg_int(1,line,file,"fd is NULL.\nShould NOT happen.");
    3737        mr_exit(-1,"Exiting");
    3838    }
    3939    va_start(args,fmt);
    4040    if (vfprintf(fd, fmt, args) < 0) {
    41         mr_msg(1,line,file,"Unable to print to fd");
     41        mr_msg_int(1,line,file,"Unable to print to fd");
    4242        mr_exit(-1,"Exiting");
    4343    }
     
    4848
    4949    if (**fd == NULL) {
    50         mr_msg(1,line,file,"fd is NULL.\nShould NOT happen.");
     50        mr_msg_int(1,line,file,"fd is NULL.\nShould NOT happen.");
    5151        mr_exit(-1,"Exiting");
    5252    }
    5353    if (*fd == NULL) {
    54         mr_msg(1,line,file,"File descriptor is NULL.\nShould NOT happen.");
     54        mr_msg_int(1,line,file,"File descriptor is NULL.\nShould NOT happen.");
    5555        mr_exit(-1,"Exiting");
    5656    }
    5757    if (fclose(*fd) < 0) {
    58         mr_msg(1,line,file,"Unable to close File Descriptor");
     58        mr_msg_int(1,line,file,"Unable to close File Descriptor");
    5959    }
    6060    *fd = NULL;
     
    6464
    6565    if (mkdir(pathname,mode) != 0) {
    66         mr_msg(1,line,file,"Unable to create directory %s",pathname);
     66        mr_msg_int(1,line,file,"Unable to create directory %s",pathname);
    6767        mr_exit(-1,"Exiting");
    6868    }
Note: See TracChangeset for help on using the changeset viewer.