Changeset 2421 in MondoRescue for branches/2.2.10/mondo/src/common
- Timestamp:
- Sep 24, 2009, 3:50:38 PM (16 years ago)
- Location:
- branches/2.2.10/mondo/src/common
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-archive.c
r2420 r2421 993 993 if (!does_file_exist(archiving_filelist_fname)) { 994 994 log_msg(3, "[%d:%d] - well, I would archive %d, except that it doesn't exist. I'll stop now.", getpid(), this_thread_no, archiving_set_no); 995 mr_free(archiving_afioball_fname); 995 996 break; 996 997 } … … 1291 1292 malloc_string(result_str); 1292 1293 transfer_block = malloc(sizeof(struct s_bkpinfo) + BKPINFO_LOC_OFFSET + 64); 1293 memset((void *) transfer_block, 0, 1294 sizeof(struct s_bkpinfo) + BKPINFO_LOC_OFFSET + 64); 1294 memset((void *) transfer_block, 0, sizeof(struct s_bkpinfo) + BKPINFO_LOC_OFFSET + 64); 1295 1295 p_last_set_archived = (int *) transfer_block; 1296 1296 p_archival_threads_running = (int *) (transfer_block + 4); 1297 1297 p_next_set_to_archive = (int *) (transfer_block + 8); 1298 1298 p_list_of_fileset_flags = (char *) (transfer_block + 12); 1299 memcpy((void *) (transfer_block + BKPINFO_LOC_OFFSET), 1300 (void *) bkpinfo, sizeof(struct s_bkpinfo)); 1299 memcpy((void *) (transfer_block + BKPINFO_LOC_OFFSET), (void *) bkpinfo, sizeof(struct s_bkpinfo)); 1301 1300 pvp = &vp; 1302 1301 vp = (void *) result_str; … … 1310 1309 "Please wait. This may take a couple of hours.", 1311 1310 "Working...", 1312 get_last_filelist_number() + 1);1311 (long)get_last_filelist_number() + 1L); 1313 1312 1314 1313 log_msg(5, "We're gonna party like it's your birthday."); -
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2405 r2421 2257 2257 char *where_is_root_mounted() { 2258 2258 /*@ buffers **************** */ 2259 char *output ;2259 char *output = NULL; 2260 2260 2261 2261 -
branches/2.2.10/mondo/src/common/libmondo-fork.c
r2420 r2421 8 8 #include "my-stuff.h" 9 9 #include "mr_mem.h" 10 #include "mr_str.h" 10 11 #include "mondostructures.h" 11 12 #include "libmondo-fork.h" … … 39 40 char *result = NULL; 40 41 char *tmpf = NULL; 42 char *newcall = NULL; 43 char *tmp = NULL; 41 44 42 45 /*@ pointers **************************************************** */ 43 FILE *fin ;46 FILE *fin = NULL; 44 47 45 48 /*@******************************************************************** */ … … 47 50 assert_string_is_neither_NULL_nor_zerolength(call); 48 51 49 mr_asprintf(tmpf, "%s/cpgll.out", bkpinfo-> scratchdir);50 mr_ strcat(call, " > %s", tmpf);51 log_msg(4, "Calling command: %s", call);52 mr_asprintf(tmpf, "%s/cpgll.out", bkpinfo->tmpdir); 53 mr_asprintf(newcall, "%s > %s", call, tmpf); 54 log_msg(4, "Calling command: %s", newcall); 52 55 /* By default return an empty string in any case */ 53 56 mr_asprintf(result, ""); 54 57 55 system(call); 56 if ((fin = fopen(ftmp, "r"))) { 58 system(newcall); 59 mr_free(newcall); 60 61 if ((fin = fopen(tmpf, "r"))) { 57 62 while (!feof(fin)) { 58 mr_getline(result, fin); 59 log_msg(9, "Loop result: %s", result); 60 } 61 log_msg(4, "Final Result: %s", result); 63 mr_getline(tmp, fin); 64 mr_chomp(tmp); 65 /* In case of extreme debug ;-) 66 log_msg(9, "Loop result: ***%s***", tmp); 67 */ 68 /* There is empty contant at the end of the file that needs to be skiped */ 69 if (strlen(tmp) > 0) { 70 mr_free(result); 71 mr_asprintf(result, "%s", tmp); 72 } 73 mr_free(tmp); 74 } 75 log_msg(4, "Result: %s", result); 62 76 mr_strip_spaces(result); 63 77 paranoid_pclose(fin); 64 78 } else { 65 log_OS_error("Unable to popen call"); 66 } 67 mr_free(ftmp) 68 log_msg(4, "Returns: %s", result); 79 log_OS_error("Unable to open resulting file"); 80 } 81 mr_free(tmpf); 69 82 return(result); 70 83 } -
branches/2.2.10/mondo/src/common/libmondo-tools-EXT.h
r2325 r2421 3 3 extern void clean_up_KDE_desktop_if_necessary(void); 4 4 extern long get_time(); 5 extern char *mr_date(void);6 5 extern void (*log_debug_msg) (int debug_level, const char *szFile, 7 6 const char *szFunction, int nLine, -
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2406 r2421 803 803 bkpinfo = (struct s_bkpinfo *)mr_malloc(sizeof(struct s_bkpinfo)); 804 804 805 /* We need tmpdir as early as possible for further function calls */ 806 bkpinfo->tmpdir = NULL; // Really setup after 807 setup_tmpdir(NULL); 808 805 809 /* Initialized in same order as in the structure declaration to detect errors more easily */ 806 810 bkpinfo->media_device = NULL; … … 822 826 bkpinfo->use_star = FALSE; 823 827 bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; 824 bkpinfo->disaster_recovery = (am_I_in_disaster_recovery_mode()? TRUE : FALSE);828 bkpinfo->disaster_recovery = am_I_in_disaster_recovery_mode(); 825 829 if (bkpinfo->disaster_recovery) { 826 830 mr_asprintf(bkpinfo->isodir, "%s", "/"); … … 829 833 } 830 834 mr_asprintf(bkpinfo->prefix, "%s", STD_PREFIX); 835 /* bkpinfo->tmpdir is here in the struct */ 831 836 bkpinfo->scratchdir = NULL; // Really setup after 832 bkpinfo->tmpdir = NULL; // Really setup after833 837 bkpinfo->optimal_set_size = 0; 834 838 bkpinfo->backup_media_type = none; … … 857 861 bkpinfo->restore_mode = interactive; 858 862 859 setup_tmpdir(NULL);860 863 sensibly_set_scratchdir(); 861 864 } … … 1364 1367 va_end(args); 1365 1368 1366 // do not slow down the progran if standard debug level1367 // must be enabled: if no flush, the log won't be up-to-date if there1368 // is a segfault1369 //if (g_dwDebugLevel != 1)1370 1371 1369 fprintf(fout, "\n"); 1372 1370 paranoid_fclose(fout); -
branches/2.2.10/mondo/src/common/libmondo-tools.h
r2325 r2421 6 6 7 7 long get_time(); 8 char *mr_date(void);9 8 extern void (*log_debug_msg) (int debug_level, const char *szFile, 10 9 const char *szFunction, int nLine, -
branches/2.2.10/mondo/src/common/newt-specific.c
r2414 r2421 96 96 extern int g_current_media_number; 97 97 pid_t g_main_pid = 0; ///< The PID of the main Mondo process. 98 long g_maximum_progress = 999 ; ///< The maximum amount of progress (100%) for the currently opened progress form.98 long g_maximum_progress = 999L; ///< The maximum amount of progress (100%) for the currently opened progress form. 99 99 long g_current_progress = -999; ///< The current amount of progress (filelist #, etc.) for the currently opened progress form. 100 100 long g_start_time = 0L; ///< The time (in seconds since the epoch) that the progress form was opened. … … 644 644 g_blurb3 = newtLabel(2, 4, blurb2); 645 645 newtCenteredWindow(60, 11, title); 646 g_scale = newtScale(3, 6, 54, g_maximum_progress);646 g_scale = newtScale(3, 6, 54, (long long)g_maximum_progress); 647 647 g_progressForm = newtForm(NULL, NULL, 0); 648 648 g_percentline = newtLabel(10, 9, "This is the percentline");
Note:
See TracChangeset
for help on using the changeset viewer.