Changeset 1081 in MondoRescue for trunk/mondo/src/common
- Timestamp:
- Jan 28, 2007, 11:20:07 PM (18 years ago)
- Location:
- trunk/mondo/src/common
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/src/common/libmondo-archive.c
r1079 r1081 820 820 821 821 if (g_getfattr) { 822 asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir);822 mr_asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir); 823 823 if (write_one_liner_data_file(tmp1, "TRUE")) { 824 824 log_msg(1, "%ld: Unable to write one-liner XATTR", … … 828 828 } 829 829 if (g_getfacl) { 830 asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir);830 mr_asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir); 831 831 if (write_one_liner_data_file(tmp1, "TRUE")) { 832 832 log_msg(1, "%ld: Unable to write one-liner ACL", … … 860 860 861 861 if (bkpinfo->backup_media_type == usb) { 862 asprintf(&tmp2, "--usb %s", bkpinfo->media_device);863 } else { 864 asprintf(&tmp2,"");862 mr_asprintf(&tmp2, "--usb %s", bkpinfo->media_device); 863 } else { 864 mr_asprintf(&tmp2,""); 865 865 } 866 866 … … 1486 1486 malloc_string(result_str); 1487 1487 transfer_block = 1488 m alloc(sizeof(struct s_bkpinfo) + BKPINFO_LOC_OFFSET + 64);1488 mr_malloc(sizeof(struct s_bkpinfo) + BKPINFO_LOC_OFFSET + 64); 1489 1489 memset((void *) transfer_block, 0, 1490 1490 sizeof(struct s_bkpinfo) + BKPINFO_LOC_OFFSET + 64); -
trunk/mondo/src/common/libmondo-filelist.c
r1046 r1081 455 455 mr_asprintf(&strtmp, syscall_sprintf, mr_stresc(file_to_analyze, "`$\\\"", '\\')); 456 456 mr_asprintf(&syscall, "%s 2>> /dev/null", strtmp); 457 paranoid_free(strtmp);457 mr_free(strtmp); 458 458 call_exe_and_pipe_output_to_fd(syscall, pout); 459 459 mr_free(syscall); … … 766 766 } 767 767 // add here 768 if (!(newnode = (struct s_node *) malloc(sizeof(struct s_node)))) { 769 log_to_screen(_("failed to malloc")); 770 depth--; 771 return (1); 772 } 768 newnode = (struct s_node *) mr_malloc(sizeof(struct s_node)); 773 769 if (char_to_add < node->ch) // add to the left of node 774 770 { … … 796 792 log_msg(6, "Adding remaining chars ('%s')", string_to_add + 1); 797 793 for (i = 1; i < noof_chars; i++) { 798 if (! 799 (node->down = 800 (struct s_node *) malloc(sizeof(struct s_node)))) { 801 log_to_screen(_("%s - failed to malloc"), string_to_add); 802 return (1); 794 node->down = (struct s_node *) mr_malloc(sizeof(struct s_node)); 803 795 } 804 796 node = node->down; … … 858 850 } 859 851 g_original_noof_lines_in_filelist = lines_in_filelist; 860 if (!(filelist = (struct s_node *) malloc(sizeof(struct s_node)))) { 861 return (NULL); 862 } 852 filelist = (struct s_node *) mr_malloc(sizeof(struct s_node)); 863 853 filelist->ch = '/'; 864 854 filelist->right = NULL; 865 filelist->down = m alloc(sizeof(struct s_node));855 filelist->down = mr_malloc(sizeof(struct s_node)); 866 856 filelist->expanded = filelist->selected = FALSE; 867 857 (filelist->down)->ch = '\0'; -
trunk/mondo/src/common/libmondo-fork.c
r1079 r1081 3 3 */ 4 4 #include "my-stuff.h" 5 #include "mr_mem.h" 5 6 #include "mondostructures.h" 6 7 #include "libmondo-fork.h" … … 79 80 assert_string_is_neither_NULL_nor_zerolength(isofile); 80 81 assert_string_is_neither_NULL_nor_zerolength(logstub); 81 if (!(midway_call = malloc(1200))) { 82 fatal_error("Cannot malloc midway_call"); 83 } 84 if (!(ultimate_call = malloc(1200))) { 85 fatal_error("Cannot malloc ultimate_call"); 86 } 87 if (!(tmp = malloc(1200))) { 88 fatal_error("Cannot malloc tmp"); 89 } 82 midway_call = mr_malloc(1200); 83 ultimate_call = mr_malloc(1200); 84 tmp = mr_malloc(1200); 90 85 91 86 mr_asprintf(&cd_number_str, "%d", cd_no); … … 350 345 log_msg(5, "Opening."); 351 346 bufcap = 256L * 1024L; 352 if (!(buf = malloc(bufcap))) { 353 fatal_error("Failed to malloc() buf"); 354 } 347 buf = mr_malloc(bufcap); 355 348 356 349 if (direction == 'w') { -
trunk/mondo/src/common/libmondo-mountlist.c
r900 r1081 1 /* $Id$2 subroutines for handling mountlist 1 /* subroutines for handling mountlist 2 $Id$ 3 3 */ 4 4 … … 16 16 #include "libmondo-string-EXT.h" 17 17 #include "newt-specific-EXT.h" 18 #include "mr_mem.h" 18 19 #include "mr_mem.h" 19 20 … … 753 754 /*@ initialize ******************************************************* */ 754 755 755 drivelist = m alloc(sizeof(struct list_of_disks));756 drivelist = mr_malloc(sizeof(struct list_of_disks)); 756 757 assert(mountlist != NULL); 757 758 -
trunk/mondo/src/common/libmondo-raid.c
r1079 r1081 18 18 #include "mr_mem.h" 19 19 #include "mr_str.h" 20 #include "mr_mem.h" 20 21 21 22 #ifdef __FreeBSD__ … … 817 818 int i, j; 818 819 static char **ret; 819 ret = (char **) m alloc(nval * sizeof(char *));820 ret = (char **) mr_malloc(nval * sizeof(char *)); 820 821 for (i = 0; i < (argc - nval); ++i) { 821 822 if (!strcmp(argv[i], option)) { 822 823 for (j = 0; j < nval; ++j) { 823 ret[j] = (char *) m alloc(strlen(argv[i + j + 1]) + 1);824 ret[j] = (char *) mr_malloc(strlen(argv[i + j + 1]) + 1); 824 825 strcpy(ret[j], argv[i + j + 1]); 825 826 } … … 1175 1176 int retval = 0; 1176 1177 1177 raidlist = m alloc(sizeof(struct raidlist_itself));1178 raidlist = mr_malloc(sizeof(struct raidlist_itself)); 1178 1179 1179 1180 // FIXME: Prefix '/dev/' should really be dynamic! -
trunk/mondo/src/common/libmondo-stream.c
r979 r1081 13 13 14 14 #include "my-stuff.h" 15 #include "mr_mem.h" 15 16 #include "mondostructures.h" 16 17 #include "libmondo-devices.h" … … 106 107 int i; 107 108 108 blk = (char *) m alloc(256 * 1024);109 blk = (char *) mr_malloc(256 * 1024); 109 110 110 111 log_it("closein_tape() -- entering"); … … 153 154 char *blk; 154 155 155 blk = (char *) m alloc(256 * 1024);156 blk = (char *) mr_malloc(256 * 1024); 156 157 157 158 sleep(1); … … 624 625 625 626 assert_string_is_neither_NULL_nor_zerolength(bkpinfo->media_device); 626 if (!(g_tapecatalog = malloc(sizeof(struct s_tapecatalog)))) { 627 fatal_error("Cannot alloc mem for tape catalog"); 628 } 627 g_tapecatalog = mr_malloc(sizeof(struct s_tapecatalog)); 629 628 g_tapecatalog->entries = 0; 630 629 g_tape_posK = 0; … … 658 657 return (-1); 659 658 } 660 if (!(datablock = (char *) malloc(256 * 1024))) { 661 log_to_screen(_("Unable to malloc 256*1024")); 662 exit(1); 663 } 659 datablock = (char *) mr_malloc(256 * 1024); 664 660 for (i = 0; i < 32; i++) { 665 661 for (j = 0; j < 4; j++) { … … 726 722 /* initialise the catalog */ 727 723 g_current_media_number = 1; 728 if (!(g_tapecatalog = malloc(sizeof(struct s_tapecatalog)))) { 729 fatal_error("Cannot alloc mem for tape catalog"); 730 } 724 g_tapecatalog = mr_malloc(sizeof(struct s_tapecatalog)); 731 725 g_tapecatalog->entries = 0; 732 726 /* log stuff */ … … 759 753 return (0); 760 754 } 761 if (!(g_tapecatalog = malloc(sizeof(struct s_tapecatalog)))) { 762 fatal_error("Cannot alloc mem for tape catalog"); 763 } 755 g_tapecatalog = mr_malloc(sizeof(struct s_tapecatalog)); 764 756 g_tapecatalog->entries = 0; 765 757 g_tape_posK = 0; … … 872 864 873 865 /*@ init ******************************************************* */ 874 datablock = m alloc(TAPE_BLOCK_SIZE);866 datablock = mr_malloc(TAPE_BLOCK_SIZE); 875 867 crc16 = 0; 876 868 crctt = 0; … … 1003 995 /*@ end vars *************************************************** */ 1004 996 1005 tempblock = (char *) m alloc((size_t) TAPE_BLOCK_SIZE);997 tempblock = (char *) mr_malloc((size_t) TAPE_BLOCK_SIZE); 1006 998 1007 999 for (i = 0; i < (int) TAPE_BLOCK_SIZE; i++) { … … 1142 1134 long bytes_to_write; 1143 1135 1144 datablock = m alloc(TAPE_BLOCK_SIZE);1136 datablock = mr_malloc(TAPE_BLOCK_SIZE); 1145 1137 pB = strrchr(the_file_I_was_reading, '/'); 1146 1138 if (pB) { -
trunk/mondo/src/common/libmondo-string.c
r900 r1081 9 9 10 10 #include "my-stuff.h" 11 #include "mr_mem.h" 11 12 #include "mondostructures.h" 12 13 #include "libmondo-string.h" -
trunk/mondo/src/common/libmondo-tools.c
r1079 r1081 9 9 10 10 #include "my-stuff.h" 11 #include "mr_mem.h" 11 12 #include "mondostructures.h" 12 13 #include "libmondo-tools.h" -
trunk/mondo/src/common/libmondo-verify.c
r1079 r1081 8 8 9 9 #include "my-stuff.h" 10 #include "mr_mem.h" 10 11 #include "mondostructures.h" 11 12 #include "libmondo-verify.h" … … 221 222 222 223 if (!bufblkA) { 223 if (!(bufblkA = malloc(maxbufsize))) { 224 fatal_error("Cannot malloc bufblkA"); 225 } 224 bufblkA = mr_malloc(maxbufsize); 226 225 } 227 226 if (!bufblkB) { 228 if (!(bufblkB = malloc(maxbufsize))) { 229 fatal_error("Cannot malloc bufblkB"); 230 } 227 bufblkB = mr_malloc(maxbufsize); 231 228 } 232 229 … … 685 682 } 686 683 mr_free(biggie_cksum); 687 688 684 return (retval); 689 685 } -
trunk/mondo/src/common/newt-specific.c
r1074 r1081 18 18 19 19 #include "my-stuff.h" 20 #include "mr_mem.h" 20 21 #include "mondostructures.h" 21 22 #include "newt-specific.h" … … 869 870 870 871 err_log_lines = 871 (char **) m alloc(sizeof(char *) * g_noof_log_lines);872 (char **) mr_malloc(sizeof(char *) * g_noof_log_lines); 872 873 if (!err_log_lines) { 873 874 fatal_error("Out of memory"); … … 1491 1492 } 1492 1493 1493 filelist = (struct s_filelist *) m alloc(sizeof(struct s_filelist));1494 filelist = (struct s_filelist *) mr_malloc(sizeof(struct s_filelist)); 1494 1495 fileListbox = 1495 1496 newtListbox(2, 2, 12, NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT);
Note:
See TracChangeset
for help on using the changeset viewer.