Changeset 1164


Ignore:
Timestamp:
Feb 14, 2007, 9:35:00 PM (13 years ago)
Author:
bruno
Message:

Compiler warning solved (M. Loiseleur again !)
Code displaced to ease memeory management in case of exit in libmondo-archive.c

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

Legend:

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

    r1160 r1164  
    12341234
    12351235    /*@ buffers *********************************** */
    1236     char *command, *tmpfile, *data_disks_file;
     1236    char *command, *tmp_file, *data_disks_file;
    12371237
    12381238    assert(bkpinfo != NULL);
     
    12501250    assert(strlen(g_serial_string) < MAX_STR_LEN);
    12511251
    1252     mr_asprintf(&tmpfile, "%s/archives/SERIAL-STRING", bkpinfo->scratchdir);
    1253     if (write_one_liner_data_file(tmpfile, g_serial_string)) {
     1252    mr_asprintf(&tmp_file, "%s/archives/SERIAL-STRING", bkpinfo->scratchdir);
     1253    if (write_one_liner_data_file(tmp_file, g_serial_string)) {
    12541254        mr_msg(1, "%ld: Failed to write serial string", __LINE__);
    12551255    }
    1256     mr_free(tmpfile);
     1256    mr_free(tmp_file);
    12571257
    12581258    mvaddstr_and_log_it(g_currentY, 0, "Preparing to archive your data");
     
    32033203    biggiestruct.use_ntfsprog = use_ntfsprog;
    32043204    optimal_set_size = bkpinfo->optimal_set_size;
    3205     if (is_this_file_compressed(biggie_filename)
    3206         || bkpinfo->compression_level == 0) {
    3207         mr_asprintf(&suffix, "");
    3208         //      log_it("%s is indeed compressed :-)", filename);
    3209         should_I_compress_slices = FALSE;
    3210     } else {
    3211         mr_asprintf(&suffix, bkpinfo->zip_suffix);
    3212         should_I_compress_slices = TRUE;
    3213     }
    32143205
    32153206    if (optimal_set_size < 999) {
     
    32433234            log_OS_error("Unable to popen-in command");
    32443235            mr_free(command);
    3245             mr_free(suffix);
    32463236            return (1);
    32473237        }
     
    32723262
    32733263    mr_asprintf(&tmp, slice_fname(biggie_file_number, 0, bkpinfo->tmpdir, ""));
    3274     fout = fopen(tmp, "w");
    3275     if (fout == NULL) {
    3276         mr_msg(1, "Unable to open and write to %s\n", tmp);
    3277         mr_free(tmp);
    3278         mr_free(suffix);
    3279         return (1);
    3280     }
     3264    fout = mr_fopen(tmp, "w");
    32813265    mr_free(tmp);
    32823266
    32833267    (void) fwrite((void *) &biggiestruct, 1, sizeof(biggiestruct), fout);
    3284     paranoid_fclose(fout);
     3268    mr_fclose(fout);
    32853269    length = totallength / optimal_set_size / 1024;
    32863270    mr_msg(1, "Opening in %s; slicing it and writing to CD/tape",
     
    32923276        log_to_screen(tmp);
    32933277        mr_free(tmp);
    3294         mr_free(suffix);
    32953278        return (1);
    32963279    }
     
    33053288                             slice_fname(biggie_file_number, 0,
    33063289                                         bkpinfo->tmpdir, ""), NULL);
     3290    }
     3291    if (is_this_file_compressed(biggie_filename)
     3292        || bkpinfo->compression_level == 0) {
     3293        mr_asprintf(&suffix, "");
     3294        should_I_compress_slices = FALSE;
     3295    } else {
     3296        mr_asprintf(&suffix, bkpinfo->zip_suffix);
     3297        should_I_compress_slices = TRUE;
    33073298    }
    33083299    i = bkpinfo->optimal_set_size / 256;
  • branches/stable/mondo/src/common/libmondo-filelist.c

    r1162 r1164  
    686686{
    687687    /*@ buffers ***************************************************** */
    688     char *val_sz;
     688    char *val_sz = NULL;
    689689    char *cfg_fname = NULL;
    690690
  • branches/stable/mondo/src/common/libmondo-raid-EXT.h

    r558 r1164  
    5050#else
    5151extern void add_disk_to_raid_device(struct list_of_disks *disklist,
    52                                     char *device_to_add, int index);
     52                                    char *device_to_add, int idx);
    5353#endif
    5454
  • branches/stable/mondo/src/include/mr_file.h

    r1137 r1164  
    2424extern FILE *mr_fopen_int(const char *path, const char *mode,int line, char *file);
    2525extern FILE *mr_fprintf_int(FILE *stream,int line, char *file, const char *fmt, ...);
    26 extern void mr_fclose_int(FILE *fd, int line, char *file);
     26extern void mr_fclose_int(FILE **fd, int line, char *file);
    2727extern void mr_mkdir_int(const char *pathname, mode_t mode, int line, char *file);
    2828
  • branches/stable/mondo/src/mondoarchive/mondo-cli-EXT.h

    r128 r1164  
    1111                                               flag_val[128][MAX_STR_LEN],
    1212                                               bool flag_set[128]);
    13 extern void help_screen();
     13extern void help_screen(void);
    1414extern void terminate_daemon(int sig);
    1515extern void set_signals(int on);
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r1156 r1164  
    943943 * Print a not-so-helpful help message and exit.
    944944 */
    945 void help_screen()
     945void help_screen(void)
    946946{
    947947    mr_msg(1, "Type 'man mondo-archive' for more information\n");
Note: See TracChangeset for help on using the changeset viewer.