Changeset 1176 in MondoRescue
- Timestamp:
- Feb 16, 2007, 2:16:14 PM (18 years ago)
- Location:
- trunk/mondo/src/common
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/src/common/libmondo-devices.c
r1161 r1176 19 19 #include "mr_mem.h" 20 20 #include "mr_msg.h" 21 #include "mr_str.h" 21 22 22 23 #include <sys/ioctl.h> … … 41 42 42 43 extern bool g_ISO_restore_mode; 43 extern struct s_bkpinfo *g_bkpinfo_DONTUSETHIS;44 44 extern char *g_erase_tmpdir_and_scratchdir; 45 45 extern char *g_selfmounted_isodir; … … 1093 1093 1094 1094 FILE *pin = NULL; 1095 bool retval ;1095 bool retval = FALSE; 1096 1096 size_t n = 0; 1097 1097 assert_string_is_neither_NULL_nor_zerolength(format); … … 1112 1112 if (!pin) { 1113 1113 log_OS_error("Unable to read good formats"); 1114 retval = FALSE;1115 1114 } else { 1116 1115 mr_getline(&good_formats, &n , pin); … … 1118 1117 log_OS_error("Cannot pclose good formats"); 1119 1118 } 1120 strip_spaces(good_formats);1119 mr_strip_spaces(good_formats); 1121 1120 // " ntfs 7 " -- um, cheating much? :) 1122 1121 mr_asprintf(&tmp, " %s swap lvm raid ntfs 7 ",good_formats); … … 1126 1125 if (strstr(good_formats, format_sz)) { 1127 1126 retval = TRUE; 1128 } else {1129 retval = FALSE;1130 1127 } 1131 1128 mr_free(good_formats); … … 1693 1690 // check whether already mounted - we better remove 1694 1691 // surrounding spaces and trailing '/' for this 1695 /* BERLIOS: Useless 1696 strip_spaces(bkpinfo->nfs_mount); 1697 */ 1692 mr_strip_spaces(bkpinfo->nfs_mount); 1698 1693 if (bkpinfo->nfs_mount[strlen(bkpinfo->nfs_mount) - 1] == '/') 1699 1694 bkpinfo->nfs_mount[strlen(bkpinfo->nfs_mount) - 1] = '\0'; … … 2270 2265 for (mr_getline(¤t_drive, &n, pdrives); !feof(pdrives); 2271 2266 mr_getline(¤t_drive, &n, pdrives)) { 2272 strip_spaces(current_drive);2267 mr_strip_spaces(current_drive); 2273 2268 log_it("looking at drive %s's MBR", current_drive); 2274 2269 if (does_string_exist_in_boot_block(current_drive, "GRUB")) { -
trunk/mondo/src/common/libmondo-files.c
r1161 r1176 18 18 #include "libmondo-fork-EXT.h" 19 19 #include "libmondo-string-EXT.h" 20 20 21 #include "mr_mem.h" 21 22 #include "mr_msg.h" 22 23 #include "mr_file.h" 23 24 … … 176 177 void exclude_nonexistent_files(char *inout) 177 178 { 178 char *infname ;179 char *outfname ;180 char *tmp ;179 char *infname = NULL; 180 char *outfname = NULL; 181 char *tmp = NULL; 181 182 char *incoming = NULL; 182 183 … … 944 945 /*@ Char buffers ** */ 945 946 char *command = NULL; 946 char *tmp ;947 char *tmp = NULL; 947 948 char old_pwd[MAX_STR_LEN]; 948 949 -
trunk/mondo/src/common/libmondo-fork.c
r1161 r1176 4 4 #include "my-stuff.h" 5 5 #include "mr_mem.h" 6 #include "mr_msg.h" 7 #include "mr_str.h" 8 6 9 #include "mondostructures.h" 7 10 #include "libmondo-fork.h" … … 10 13 #include "libmondo-files-EXT.h" 11 14 #include "libmondo-tools-EXT.h" 12 #include "mr_mem.h"13 15 14 16 extern bool g_text_mode; … … 164 166 165 167 /*@ pointers *************************************************** */ 166 FILE *fin ;167 char *p ;168 FILE *fin = NULL; 169 char *p = NULL; 168 170 169 171 /*@ end vars *************************************************** */ … … 188 190 *p = ' '; 189 191 } /* single '=' is intentional */ 190 191 192 192 193 res = system(callstr); … … 208 209 fin = fopen("/tmp/mondo-run-prog-thing.tmp", "r"); 209 210 if (fin) { 210 for (mr_getline(&incoming, &n, fin); !feof(fin); 211 mr_getline(&incoming, &n, fin)) { 211 for (mr_getline(&incoming, &n, fin); !feof(fin); mr_getline(&incoming, &n, fin)) { 212 212 /* patch by Heiko Schlittermann */ 213 213 p = incoming; … … 219 219 } 220 220 /* end of patch */ 221 strip_spaces(incoming);221 mr_strip_spaces(incoming); 222 222 if ((res == 0 && log_if_success) 223 223 || (res != 0 && log_if_failure)) { … … 238 238 } 239 239 } 240 // else241 // { mr_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); }242 240 return (res); 243 241 } … … 339 337 // if dir=='r' then copy from archived to orig 340 338 char *tmp = NULL; 339 char *tmp1 = NULL; 341 340 char *buf = NULL; 342 341 long int bytes_to_be_read, bytes_read_in, bytes_written_out = … … 354 353 fin = f_orig; 355 354 fout = f_archived; 356 mr_asprintf(&tmp , "%-64s", PIMP_START_SZ);357 if (fwrite(tmp , 1, 64, fout) != 64) {355 mr_asprintf(&tmp1, "%-64s", PIMP_START_SZ); 356 if (fwrite(tmp1, 1, 64, fout) != 64) { 358 357 fatal_error("Can't write the introductory block"); 359 358 } 360 mr_free(tmp );359 mr_free(tmp1); 361 360 362 361 while (1) { … … 365 364 break; 366 365 } 367 mr_asprintf(&tmp , "%-64ld", bytes_read_in);368 if (fwrite(tmp , 1, 64, fout) != 64) {366 mr_asprintf(&tmp1, "%-64ld", bytes_read_in); 367 if (fwrite(tmp1, 1, 64, fout) != 64) { 369 368 fatal_error("Cannot write introductory block"); 370 369 } 371 mr_free(tmp );370 mr_free(tmp1); 372 371 373 372 mr_msg(7, … … 375 374 subsliceno, bytes_read_in, bytes_to_be_read); 376 375 bytes_written_out += fwrite(buf, 1, bytes_read_in, fout); 377 mr_asprintf(&tmp , "%-64ld", subsliceno);378 if (fwrite(tmp , 1, 64, fout) != 64) {376 mr_asprintf(&tmp1, "%-64ld", subsliceno); 377 if (fwrite(tmp1, 1, 64, fout) != 64) { 379 378 fatal_error("Cannot write post-thingy block"); 380 379 } 381 mr_free(tmp );380 mr_free(tmp1); 382 381 383 382 mr_msg(7, "Subslice #%d written OK", subsliceno); … … 391 390 fin = f_archived; 392 391 fout = f_orig; 393 if (!(tmp = malloc(64L))) { 394 fatal_error("Failed to malloc() tmp"); 395 } 392 tmp = mr_malloc(64L); 396 393 if (fread(tmp, 1, 64L, fin) != 64L) { 397 394 fatal_error("Cannot read the introductory block"); … … 433 430 434 431 if (direction == 'w') { 435 mr_free(tmp); 436 mr_asprintf(&tmp, "%-64s", PIMP_END_SZ); 437 if (fwrite(tmp, 1, 64L, fout) != 64L) { 432 mr_asprintf(&tmp1, "%-64s", PIMP_END_SZ); 433 if (fwrite(tmp1, 1, 64L, fout) != 64L) { 438 434 fatal_error("Can't write the final block"); 439 435 } 440 mr_free(tmp );436 mr_free(tmp1); 441 437 } else { 442 438 mr_msg(1, "tmpA is %s", tmp); … … 468 464 } 469 465 } 470 mr_free(tmp);471 466 } 472 467 473 468 mr_free(buf); 469 mr_free(tmp); 474 470 mr_msg(3, "Successfully copied %ld bytes", bytes_written_out); 475 471 return (retval); -
trunk/mondo/src/common/libmondo-mountlist.c
r1161 r1176 2 2 $Id$ 3 3 */ 4 4 5 5 6 /** … … 21 22 /*@unused@*/ 22 23 //static char cvsid[] = "$Id$"; 23 24 /**25 * A global copy of @c bkpinfo, to aid in debugging. As the name implies, <em>don't use this</em>.26 * @ingroup globalGroup27 */28 struct s_bkpinfo *g_bkpinfo_DONTUSETHIS = NULL;29 24 30 25 /** … … 77 72 /*@ initialize ***************************************************** */ 78 73 prev_part_no = 0; 79 // BERLIOS: tmp[0] = '\0';80 74 81 75 … … 83 77 84 78 if (physical_drive_size < 0) { 85 mr_asprintf(&tmp, " %s does not exist.", drive); 79 mr_asprintf(&tmp, "%s %s does not exist.", flaw_str, drive); 80 mr_free(flaw_str); 86 81 flaws_str = tmp; 87 82 } else { … … 225 220 return ++res; // fatal error 226 221 } 222 223 mr_asprintf(&device, "%ss%d", drive, curr_part_no); 227 224 // BERLIOS : useless ? mr_asprintf(&mountpoint, mountlist->el[pos].mountpoint); 228 225 if (pos > 0 && !npos) { 229 mr_asprintf(&device, "%ss%d", drive, curr_part_no);230 226 /* gap in the partition list? */ 231 227 if (curr_part_no - prev_part_no > 1) { … … 346 342 res++; 347 343 } 348 mr_free(device);349 344 } else { 350 345 /* Check subpartitions */ 351 346 for (cur_sp_no = 'a'; cur_sp_no < 'z'; ++cur_sp_no) { 352 mr_asprintf(&device, "%ss%d%c", drive, curr_part_no, 353 cur_sp_no); 347 mr_asprintf(&device, "%ss%d%c", drive, curr_part_no, cur_sp_no); 354 348 pos = find_device_in_mountlist(mountlist, device); 355 349 if (pos < 0) { … … 446 440 amount_allocated += mountlist->el[pos].size / 1024; 447 441 prev_sp_no = cur_sp_no; 448 mr_free(device);449 450 }442 } 443 } 444 mr_free(device); 451 445 452 446 /* OK, continue with main loop */ … … 482 476 flaws_str = tmp1; 483 477 mr_free(tmp); 478 /* BERLIOS: Flawed since rev 1 !! */ 479 res++; 484 480 } 485 481 if (res) { … … 521 517 522 518 prev_part_no = 0; 523 // BERLIOS : useless ? tmp[0] = '\0';524 525 519 526 520 physical_drive_size = get_phys_size_of_drive(drive); … … 582 576 || (curr_part_no <= 4 && prev_part_no > 0)) { 583 577 mr_asprintf(&tmp, " Gap between %s%d and %d.", drive, 584 578 prev_part_no, curr_part_no); 585 579 log_it(tmp); 586 580 if (flaws_str) { … … 716 710 flaws_str = tmp1; 717 711 mr_free(tmp); 712 /* BERLIOS: Flawed since rev 1 !! - Is it sure ?? */ 713 res++; 718 714 } 719 715 … … 743 739 744 740 /*@ buffer *********************************************************** */ 745 struct list_of_disks *drivelist ;746 char *tmp ;747 char *tmp1 ;748 char *flaws_str ;741 struct list_of_disks *drivelist = NULL; 742 char *tmp = NULL; 743 char *tmp1 = NULL; 744 char *flaws_str = NULL; 749 745 750 746 /*@ int ************************************************************** */ … … 856 852 && strcmp(curr_mountpoint, "raid")) { 857 853 mr_asprintf(&tmp, " %s %s's.", number_to_text(copies), 858 854 curr_mountpoint); 859 855 log_it(tmp); 860 856 mr_asprintf(&tmp1, "%s%s",flaws_str, tmp); … … 887 883 888 884 /*@ buffers ********************************************************* */ 889 char *drive; 890 char *tmp; 885 char *drive = NULL; 891 886 892 887 long long size; … … 899 894 mr_asprintf(&drive, mountlist->el[lino].device); 900 895 if (!strncmp(drive, RAID_DEVICE_STUB, strlen(RAID_DEVICE_STUB))) { 901 mr_asprintf(&tmp, 902 "Not putting %s in list of drives: it's a virtual drive", 903 drive); 904 mr_msg(8, tmp); 905 mr_free(tmp); 896 mr_msg(8, "Not putting %s in list of drives: it's a virtual drive", drive); 906 897 continue; 907 898 } … … 909 900 size = mountlist->el[lino].size; 910 901 if (size == 0) { 911 mr_asprintf(&tmp, 912 "Not putting %s in list of drives: it has zero size (maybe an LVM volume)", 913 drive); 914 mr_msg(8, tmp); 915 mr_free(tmp); 902 mr_msg(8, "Not putting %s in list of drives: it has zero size (maybe an LVM volume)", drive); 916 903 continue; 917 904 } 918 905 919 /* 920 for (i = strlen (drive); isdigit (drive[i - 1]); i--); 921 drive[i] = '\0'; 922 if (get_phys_size_of_drive (drive) <= 0 && drive[i - 1] == 'p') 923 { 924 i--; 925 drive[i] = '\0'; 926 } 927 for (j = 0; j < noof_drives && strcmp (drivelist[j], drive) != 0; j++); 928 */ 929 930 mr_asprintf(&tmp, 931 "Putting %s with size %lli in list of drives", 932 drive, size); 933 mr_msg(8, tmp); 934 mr_free(tmp); 906 mr_msg(8, "Putting %s with size %lli in list of drives", drive, size); 935 907 936 908 (void) truncate_to_drive_name(drive); … … 960 932 */ 961 933 void make_list_of_unallocated_raid_partitions(struct mountlist_itself 962 *output_list, struct mountlist_itself 963 *mountlist, struct raidlist_itself 934 *output_list, 935 struct mountlist_itself 936 *mountlist, 937 struct raidlist_itself 964 938 *raidlist) 965 939 { … … 971 945 972 946 /*@ buffers ********************************************************* */ 973 char *tmp ;947 char *tmp = NULL; 974 948 975 949 assert(output_list != NULL); … … 1043 1017 int load_mountlist(struct mountlist_itself *mountlist, char *fname) 1044 1018 { 1045 FILE *fin ;1019 FILE *fin = NULL; 1046 1020 /* malloc ** */ 1047 1021 char *incoming = NULL; 1048 char *siz ;1049 char *tmp ;1050 char *p ;1051 1052 int items ;1053 int j ;1022 char *siz = NULL; 1023 char *tmp = NULL; 1024 char *p = NULL; 1025 1026 int items = 0; 1027 int j = 0; 1054 1028 size_t n = 0; 1055 1029 1056 1030 assert(mountlist != NULL); 1057 1031 assert_string_is_neither_NULL_nor_zerolength(fname); 1058 malloc_string(siz); 1032 1059 1033 if (!(fin = fopen(fname, "r"))) { 1060 1034 log_it("Unable to open mountlist - '%s'", fname); 1061 1035 log_to_screen(_("Cannot open mountlist")); 1062 mr_free(siz);1063 1036 return (1); 1064 1037 } 1065 items = 0;1038 malloc_string(siz); 1066 1039 mr_getline(&incoming, &n, fin); 1067 1040 log_it("Loading mountlist..."); … … 1130 1103 mr_free(tmp); 1131 1104 1132 mr_asprintf(&tmp, 1133 "%s %s %s %lld %s", 1105 log_it("%s %s %s %lld %s", 1134 1106 mountlist->el[items].device, 1135 1107 mountlist->el[items].mountpoint, … … 1137 1109 mountlist->el[items].size, 1138 1110 mountlist->el[items].label); 1139 1140 log_it(tmp);1141 mr_free(tmp);1142 1111 items++; 1143 1112 } … … 1149 1118 1150 1119 log_it("Mountlist loaded successfully."); 1151 mr_asprintf(&tmp, "%d entries in mountlist", items); 1152 log_it(tmp); 1153 mr_free(tmp); 1120 log_it("%d entries in mountlist", items); 1154 1121 1155 1122 mr_free(siz); 1156 1123 return (0); 1157 1124 } 1158 1159 1125 1160 1126 … … 1256 1222 { 1257 1223 /*@ mallocs *** */ 1258 char *device ;1259 char *mountpoint ;1260 char *format ;1224 char *device = NULL; 1225 char *mountpoint = NULL; 1226 char *format = NULL; 1261 1227 1262 1228 long long size; … … 1283 1249 1284 1250 mountlist->el[b].size = size; 1251 mr_free(device); 1252 mr_free(mountpoint); 1253 mr_free(format); 1285 1254 } 1286 1255 -
trunk/mondo/src/common/libmondo-raid.c
r1106 r1176 10 10 #include "my-stuff.h" 11 11 #include "mr_str.h" 12 #include "mr_mem.h" 13 #include "mr_msg.h" 14 12 15 #include "mondostructures.h" 13 16 #include "newt-specific-EXT.h" … … 16 19 #include "libmondo-string-EXT.h" 17 20 #include "libmondo-raid.h" 18 #include "mr_mem.h"19 #include "mr_str.h"20 #include "mr_mem.h"21 21 22 22 #ifdef __FreeBSD__ … … 47 47 #else 48 48 /*@ buffer ********************************************************** */ 49 char *command ;50 int res ;49 char *command = NULL; 50 int res = 0; 51 51 52 52 if (raidno == -1) { … … 228 228 #endif 229 229 230 230 231 /** 231 232 * Save the additional RAID variables to a stream. … … 316 317 #ifdef __FreeBSD__ 317 318 int i, j; 319 char *org = NULL; 318 320 319 321 fprintf(fout, "\nvolume %s\n", raidrec->volname); 320 322 for (i = 0; i < raidrec->plexes; ++i) { 321 char *org;322 323 switch (raidrec->plex[i].raidlevel) { 323 324 case -1: 324 mr_asprintf(&org, " %s", "concat");325 mr_asprintf(&org, "concat"); 325 326 break; 326 327 case 0: 327 mr_asprintf(&org, " %s", "striped");328 mr_asprintf(&org, "striped"); 328 329 break; 329 330 case 5: 330 mr_asprintf(&org, " %s", "raid5");331 mr_asprintf(&org, "raid5"); 331 332 break; 332 333 } … … 422 423 for (mr_getline(&incoming, &n, fin); !feof(fin); 423 424 mr_getline(&incoming, &n, fin)) { 424 strip_spaces(incoming);425 mr_strip_spaces(incoming); 425 426 p = strchr(incoming, ' '); 426 427 if (strlen(incoming) < 3 || incoming[0] == '#' || !p) { … … 450 451 char *fname) 451 452 { 452 FILE *fin; 453 char *tmp1; 454 int items; 453 FILE *fin = NULL; 454 int items = 0; 455 455 456 456 raidlist->spares.entries = 0; … … 499 499 } 500 500 } else if (!strcmp(argv[0], "volume")) { 501 char *volname ;501 char *volname = NULL; 502 502 if (argc < 2) 503 503 continue; … … 508 508 } else if (!strcmp(argv[0], "plex")) { 509 509 int raidlevel, stripesize; 510 char *org = 0;511 char **tmp = 0;510 char *org = NULL; 511 char **tmp = NULL; 512 512 if (argc < 3) 513 513 continue; … … 546 546 } else if ((!strcmp(argv[0], "sd")) 547 547 || (!strcmp(argv[0], "subdisk"))) { 548 char *drive = 0;548 char *drive = NULL; 549 549 if (argc < 3) 550 550 continue; … … 565 565 fclose(fin); 566 566 log_it("Raidtab loaded successfully."); 567 mr_asprintf(&tmp1, "%d RAID devices in raidtab", raidlist->entries); 568 log_it(tmp1); 569 mr_free(tmp1); 567 log_it("%d RAID devices in raidtab", raidlist->entries); 570 568 return (0); 571 569 } … … 647 645 648 646 /*@ add mallocs * */ 649 char *tmp = NULL;650 647 char *labelB = NULL; 651 648 char *valueB = NULL; … … 701 698 } 702 699 if (!disklist) { 703 mr_asprintf(&tmp, 704 "Ignoring '%s %s' pair of disk %s", labelB, valueB, 705 label); 706 log_it(tmp); 707 mr_free(tmp); 700 log_it("Ignoring '%s %s' pair of disk %s", labelB, valueB, 701 label); 708 702 } else { 709 703 add_disk_to_raid_device(disklist, value, atoi(valueB)); … … 932 926 const char delims[] = " "; 933 927 934 FILE *fin; 935 int row, i, index_min; 928 FILE *fin = NULL; 929 int row = 0; 930 int i = 0; 931 int index_min = 0; 936 932 int lastpos = 0; 937 933 size_t len = 0; 938 char *token;934 char *token = NULL; 939 935 char *string = NULL; 940 char *pos ;941 char type ;942 char *strtmp ;936 char *pos = NULL; 937 char type = NULL; 938 char *strtmp = NULL; 943 939 944 940 // open file … … 982 978 mr_asprintf(&strtmp,"%s%s", device_prefix, token); 983 979 raidlist->el[raidlist->entries].raid_device = strtmp; 980 mr_free(strtmp); 984 981 mr_free(token); 985 982 // skip ':' and status -
trunk/mondo/src/common/libmondo-stream.c
r1086 r1176 14 14 #include "my-stuff.h" 15 15 #include "mr_mem.h" 16 #include "mr_msg.h" 17 16 18 #include "mondostructures.h" 17 19 #include "libmondo-devices.h" … … 23 25 #include "libmondo-tools-EXT.h" 24 26 #include "libmondo-fifo-EXT.h" 25 #include "mr_mem.h"26 27 27 28 #define EXTRA_TAPE_CHECKSUMS 28 29 30 /*@unused@*/ 31 //static char cvsid[] = "$Id$"; 29 32 extern bool g_sigpipe; 30 33 extern int g_tape_buffer_size_MB; … … 132 135 } 133 136 mr_free(blk); 134 mr_free( (void *)g_tapecatalog);137 mr_free(g_tapecatalog); 135 138 return (retval); 136 139 } … … 151 154 152 155 /*@ long long's ************************************************* */ 153 int i ;154 char *blk ;156 int i = 0; 157 char *blk = NULL; 155 158 156 159 blk = (char *) mr_malloc(256 * 1024); … … 186 189 } 187 190 mr_free(blk); 188 mr_free( (void *)g_tapecatalog);191 mr_free(g_tapecatalog); 189 192 return (retval); 190 193 } … … 251 254 252 255 mr_asprintf(&command, 253 254 256 "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1", 257 cdr_exe); 255 258 tmp = call_program_and_get_last_line_of_output(command); 256 259 mr_free(command); … … 264 267 265 268 mr_asprintf(&command, 266 267 269 "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1", 270 cdr_exe); 268 271 mr_free(cdr_exe); 269 272 … … 339 342 } 340 343 } 344 341 345 342 346 int read_EXAT_files_from_tape(struct s_bkpinfo *bkpinfo, … … 450 454 { 451 455 int i; 452 char *tmp ;456 char *tmp = NULL; 453 457 454 458 log_it("Insisting on tape #%d", tapeno); … … 488 492 489 493 490 491 492 494 /** 493 495 * Add a file to a collection of recently archived filesets/slices. … … 507 509 int last, curr, i; 508 510 t_archtype type = other; 509 char *command ;510 char *tmpdir ;511 char *old_fname ;511 char *command = NULL; 512 char *tmpdir = NULL; 513 char *old_fname = NULL; 512 514 513 515 bufsize_K = (long long) (1024LL * (1 + g_tape_buffer_size_MB)); 514 mr_asprintf(&tmpdir, "%s/tmpfs/backcatalog", td);515 516 if (strstr(latest_fname, ".afio.") || strstr(latest_fname, ".star.")) { 516 517 type = fileset; … … 522 523 ("Unknown type. Internal error in maintain_collection_of_recent_archives()"); 523 524 } 525 526 mr_asprintf(&tmpdir, "%s/tmpfs/backcatalog", td); 524 527 mkdir(tmpdir, 0x700); 525 528 mr_asprintf(&command, "cp -f %s %s", latest_fname, tmpdir); … … 603 606 { 604 607 /*@ buffer ***************************************************** */ 605 char *datablock ;606 char *tmp ;608 char *datablock = NULL; 609 char *tmp = NULL; 607 610 char old_cwd[MAX_STR_LEN]; 608 char *outfname ;611 char *outfname = NULL; 609 612 /*@ int ******************************************************* */ 610 613 int i; … … 649 652 log_to_screen(_("Reading stream")); 650 653 log_it("stream device = '%s'", bkpinfo->media_device); 651 /* skip data disks */654 /* skip data disks */ 652 655 open_evalcall_form("Skipping data disks on stream"); 653 656 log_to_screen(_("Skipping data disks on stream")); … … 712 715 { 713 716 /*@ buffers ***************************************************** */ 714 char *command ;717 char *command = NULL; 715 718 716 719 /*@ end vars *************************************************** */ … … 832 835 { 833 836 /*@ buffers ***************************************************** */ 834 char *tmp ;835 char *datablock ;837 char *tmp = NULL; 838 char *datablock = NULL; 836 839 char *temp_fname = (char *)bkpinfo; /* Should NOT be NULL */ 837 840 char *temp_cksum = (char *)bkpinfo; /* Should NOT be NULL */ 838 char *actual_cksum ;841 char *actual_cksum = NULL; 839 842 840 843 /*@ int ********************************************************* */ … … 1289 1292 { 1290 1293 int res = 0; 1291 char *command ;1294 char *command = NULL; 1292 1295 1293 1296 paranoid_pclose(g_tape_stream); … … 1348 1351 { 1349 1352 int i, last, res = 0; 1350 char *fname ;1353 char *fname = NULL; 1351 1354 1352 1355 mr_msg(2, "I am now writing back catalog to tape"); … … 1387 1390 { 1388 1391 /*@ pointers *************************************************** */ 1389 FILE *fin ;1390 char *tmp ;1392 FILE *fin = NULL; 1393 char *tmp = NULL; 1391 1394 1392 1395 /*@ long ******************************************************* */ … … 1449 1452 { 1450 1453 /*@ buffers **************************************************** */ 1451 char *tmp ;1454 char *tmp = NULL; 1452 1455 char datablock[TAPE_BLOCK_SIZE]; 1453 char *checksum ;1454 char *infile_basename ;1456 char *checksum = NULL; 1457 char *infile_basename = NULL; 1455 1458 1456 1459 /*@ int ******************************************************** */ … … 1570 1573 /*@ buffers **************************************************** */ 1571 1574 char tempblock[TAPE_BLOCK_SIZE]; 1572 char *tmp;1573 1575 char *p; 1574 1576 … … 1603 1605 fwrite(tempblock, 1, (size_t) TAPE_BLOCK_SIZE, 1604 1606 g_tape_stream) / 1024; 1605 mr_asprintf(&tmp, "%s (fname=%s, size=%ld K)", 1606 marker_to_string(control_char), p, 1607 (long) length_of_incoming_file >> 10); 1608 mr_msg(6, tmp); 1609 mr_free(tmp); 1607 mr_msg(6, "%s (fname=%s, size=%ld K)", 1608 marker_to_string(control_char), p, 1609 (long) length_of_incoming_file >> 10); 1610 1610 return (0); 1611 1611 } … … 1620 1620 { 1621 1621 /*@ buffer ***************************************************** */ 1622 char *tmp ;1622 char *tmp = NULL; 1623 1623 1624 1624
Note:
See TracChangeset
for help on using the changeset viewer.