Changeset 2241 in MondoRescue for branches/2.2.9/mondo/src/mondoarchive
- Timestamp:
- Jun 29, 2009, 7:19:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/mondoarchive/mondoarchive.c
r2211 r2241 76 76 tmp = get_uname_m(); 77 77 log_msg(0, "running on %s architecture", tmp); 78 free(tmp);78 mr_free(tmp); 79 79 log_msg(0, 80 80 "-----------------------------------------------------------"); … … 138 138 void distro_specific_kludges_at_end_of_mondoarchive(void) 139 139 { 140 // char tmp[500];141 140 log_msg(2, "Restarting magicdev if necessary"); 142 141 sync(); … … 166 165 int main(int argc, char *argv[]) 167 166 { 168 char *tmp ;167 char *tmp = NULL; 169 168 char *tmp1 = NULL; 170 169 int res, retval; … … 196 195 retval = 0; 197 196 diffs = 0; 198 malloc_string(tmp);199 197 malloc_libmondo_global_strings(); 200 198 … … 244 242 if (argc == 4 && !strcmp(argv[1], "setfattr")) { 245 243 g_loglevel = 10; 246 // chdir("/tmp");247 244 g_text_mode = TRUE; 248 245 setup_newt_stuff(); … … 254 251 g_text_mode = TRUE; 255 252 setup_newt_stuff(); 253 malloc_string(tmp); 256 254 turn_wildcard_chars_into_literal_chars(tmp, argv[2]); 257 255 printf("in=%s; out=%s\n", argv[2], tmp); 256 paranoid_free(tmp); 258 257 finish(1); 259 258 } … … 273 272 if (argc == 4 && !strcmp(argv[1], "setfacl")) { 274 273 g_loglevel = 10; 275 // chdir("/tmp");276 274 g_text_mode = TRUE; 277 275 setup_newt_stuff(); … … 283 281 g_text_mode = TRUE; 284 282 setup_newt_stuff(); 283 malloc_string(tmp); 285 284 if (find_cdrw_device(tmp)) { 286 285 printf("Failed to find CDR-RW drive\n"); … … 294 293 printf("CD-ROM is at %s\n", tmp); 295 294 } 295 paranoid_free(tmp); 296 296 finish(0); 297 297 } … … 301 301 g_text_mode = TRUE; 302 302 setup_newt_stuff(); 303 malloc_string(tmp); 303 304 if (find_dvd_device(tmp, atoi(argv[2]))) { 304 305 printf("Failed to find DVD drive\n"); … … 306 307 printf("DVD is at %s\n", tmp); 307 308 } 309 paranoid_free(tmp); 308 310 finish(0); 309 311 } … … 373 375 res = verify_data(); 374 376 if (res < 0) { 375 sprintf(tmp, "%d difference%c found.", -res,377 mr_asprintf(&tmp, "%d difference%c found.", -res, 376 378 (-res != 1) ? 's' : ' '); 377 379 mr_asprintf(&say_at_end, tmp); 378 380 log_to_screen(tmp); 381 mr_free(tmp); 379 382 res = 0; 380 383 } … … 412 415 paranoid_free(say_at_end); 413 416 } 414 sprintf(tmp, "umount %s/tmpfs", bkpinfo->tmpdir);417 mr_asprintf(&tmp, "umount %s/tmpfs", bkpinfo->tmpdir); 415 418 run_program_and_log_output(tmp, TRUE); 419 mr_free(tmp); 416 420 if (bkpinfo->backup_media_type == usb) { 417 421 log_msg(1, "Unmounting USB device."); 418 sprintf(tmp, "umount %s1", bkpinfo->media_device);422 mr_asprintf(&tmp, "umount %s1", bkpinfo->media_device); 419 423 run_program_and_log_output(tmp, TRUE); 424 mr_free(tmp); 420 425 } 421 426
Note:
See TracChangeset
for help on using the changeset viewer.