Changeset 1138 in MondoRescue for branches/stable/mondo
- Timestamp:
- Feb 11, 2007, 3:08:34 PM (18 years ago)
- Location:
- branches/stable/mondo/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/libmondo-archive.c
r1137 r1138 1716 1716 1717 1717 /*@ buffers ****************************************** */ 1718 char *tmp ;1718 char *tmp = NULL; 1719 1719 char *old_pwd; 1720 char *result_sz ;1721 char *message_to_screen ;1722 char *sz_blank_disk ;1720 char *result_sz = NULL; 1721 char *message_to_screen = NULL; 1722 char *sz_blank_disk = NULL; 1723 1723 char *tmp2 = NULL; 1724 1724 char *tmp3 = NULL; … … 1726 1726 1727 1727 malloc_string(old_pwd); 1728 malloc_string(result_sz);1729 malloc_string(message_to_screen);1730 malloc_string(sz_blank_disk);1731 tmp = mr_malloc(1200);1732 1728 assert(bkpinfo != NULL); 1733 1729 assert_string_is_neither_NULL_nor_zerolength(destfile); 1734 1730 1735 sprintf(tmp, "%s/isolinux.bin", bkpinfo->scratchdir);1731 mr_asprintf(&tmp, "%s/isolinux.bin", bkpinfo->scratchdir); 1736 1732 mr_asprintf(&tmp2, "%s/isolinux.bin", bkpinfo->tmpdir); 1737 1733 if (does_file_exist(tmp)) { … … 1746 1742 } 1747 1743 mr_free(tmp2); 1744 mr_free(tmp); 1745 1748 1746 if (bkpinfo->backup_media_type == iso && bkpinfo->manual_cd_tray) { 1749 1747 popup_and_OK(_("Please insert new media and press Enter.")); … … 1754 1752 /* BERLIOS: Do not ignore getcwd result */ 1755 1753 (void) getcwd(old_pwd, MAX_STR_LEN - 1); 1756 sprintf(tmp, "chmod 744%s", bkpinfo->scratchdir);1754 mr_asprintf(&tmp, "chmod 755 %s", bkpinfo->scratchdir); 1757 1755 run_program_and_log_output(tmp, FALSE); 1756 mr_free(tmp); 1758 1757 chdir(bkpinfo->scratchdir); 1759 1758 1760 1759 if (bkpinfo->call_before_iso[0] != '\0') { 1761 sprintf(message_to_screen, "Running pre-ISO call for CD#%d",1760 mr_asprintf(&message_to_screen, "Running pre-ISO call for CD#%d", 1762 1761 g_current_media_number); 1763 res = 1764 eval_call_to_make_ISO(bkpinfo, bkpinfo->call_before_iso, 1765 destfile, g_current_media_number, 1766 MONDO_LOGFILE, message_to_screen); 1762 res = eval_call_to_make_ISO(bkpinfo, bkpinfo->call_before_iso, 1763 destfile, g_current_media_number, 1764 MONDO_LOGFILE, message_to_screen); 1767 1765 if (res) { 1768 strcat(message_to_screen, "...failed");1766 log_to_screen("%s...failed", message_to_screen); 1769 1767 } else { 1770 strcat(message_to_screen, "...OK");1771 } 1772 log_to_screen(message_to_screen);1768 log_to_screen("%s...OK", message_to_screen); 1769 } 1770 mr_free(message_to_screen); 1773 1771 retval += res; 1774 1772 } … … 1776 1774 if (bkpinfo->call_make_iso[0] != '\0') { 1777 1775 mr_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso); 1778 sprintf(tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir);1779 sprintf(message_to_screen, "Making an ISO (%s #%d)",1780 media_descriptor_string(bkpinfo->backup_media_type),1781 g_current_media_number); 1782 1783 pause_and_ask_for_cdr(2, &cd_is_mountable); /* if g_current_media_number >= 2 then pause & ask */1776 mr_asprintf(&message_to_screen, "Making an ISO (%s #%d)", 1777 bkpinfo->backup_media_string, 1778 g_current_media_number); 1779 1780 /* if g_current_media_number >= 2 then pause & ask */ 1781 pause_and_ask_for_cdr(2, &cd_is_mountable); 1784 1782 if (retval) { 1785 1783 log_to_screen 1786 1784 ("Serious error(s) occurred already. I shan't try to write to media."); 1787 1785 } else { 1788 res = 1789 eval_call_to_make_ISO(bkpinfo, bkpinfo->call_make_iso, 1790 bkpinfo->scratchdir, 1791 g_current_media_number, 1792 MONDO_LOGFILE, message_to_screen); 1786 res = eval_call_to_make_ISO(bkpinfo, bkpinfo->call_make_iso, 1787 bkpinfo->scratchdir, 1788 g_current_media_number, 1789 MONDO_LOGFILE, message_to_screen); 1793 1790 if (res) { 1794 1791 log_to_screen("%s...failed to write", message_to_screen); … … 1804 1801 retval += res; 1805 1802 #ifdef DVDRWFORMAT 1806 sprintf(tmp,1807 "tail -n8 %s | grep 'blank=full.*dvd-compat.*DAO'",1808 MONDO_LOGFILE);1803 mr_asprintf(&tmp, 1804 "tail -n8 %s | grep 'blank=full.*dvd-compat.*DAO'", 1805 MONDO_LOGFILE); 1809 1806 if (g_backup_media_type == dvd 1810 1807 && (res || !run_program_and_log_output(tmp, 1))) { … … 1822 1819 } 1823 1820 pause_for_N_seconds(5, "Letting DVD drive settle"); 1824 sprintf(sz_blank_disk, "dvd+rw-format -force %s",1825 bkpinfo->media_device);1821 mr_asprintf(&sz_blank_disk, "dvd+rw-format -force %s", 1822 bkpinfo->media_device); 1826 1823 mr_msg(3, "sz_blank_disk = '%s'", sz_blank_disk); 1827 res = 1828 run_external_binary_with_percentage_indicator_NEW 1824 res = run_external_binary_with_percentage_indicator_NEW 1829 1825 ("Blanking DVD disk", sz_blank_disk); 1830 1826 if (res) { … … 1833 1829 pause_for_N_seconds(5, 1834 1830 "Letting DVD drive settle... and trying again."); 1835 res = 1836 run_external_binary_with_percentage_indicator_NEW 1831 res = run_external_binary_with_percentage_indicator_NEW 1837 1832 ("Blanking DVD disk", sz_blank_disk); 1838 1833 if (res) { … … 1843 1838 ("Format succeeded. Sleeping for 5 seconds to take a breath..."); 1844 1839 } 1840 mr_free(sz_blank_disk); 1845 1841 pause_for_N_seconds(5, "Letting DVD drive settle"); 1846 1842 if (!bkpinfo->please_dont_eject) { … … 1868 1864 } 1869 1865 } 1866 mr_free(tmp); 1870 1867 #endif 1871 1868 if (g_backup_media_type == dvd && !bkpinfo->please_dont_eject) { … … 1873 1870 } 1874 1871 } 1875 } else { 1876 sprintf(message_to_screen, "Running mkisofs to make %s #%d", 1877 media_descriptor_string(bkpinfo->backup_media_type), 1878 g_current_media_number); 1872 mr_free(message_to_screen); 1873 } else { 1874 mr_asprintf(&message_to_screen, "Running mkisofs to make %s #%d", 1875 bkpinfo->backup_media_string, 1876 g_current_media_number); 1879 1877 mr_msg(1, message_to_screen); 1880 1878 sprintf(result_sz, "Call to mkisofs to make ISO (%s #%d) ", … … 1917 1915 // and add ' .' at end 1918 1916 mr_msg(1, "Non-ia64 --> lilo"); 1919 res = 1920 eval_call_to_make_ISO(bkpinfo,1921 "mkisofs -b images/mindi-bootroot.2880.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",1922 destfile,g_current_media_number,1923 1924 1917 res = eval_call_to_make_ISO(bkpinfo, 1918 "mkisofs -b images/mindi-bootroot.2880.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", 1919 destfile, 1920 g_current_media_number, 1921 MONDO_LOGFILE, 1922 message_to_screen); 1925 1923 #endif 1926 1924 } else { … … 1935 1933 } 1936 1934 } 1935 mr_free(message_to_screen); 1937 1936 if (res) { 1938 strcat(result_sz, "...failed");1937 log_to_screen("%s...failed", result_sz); 1939 1938 } else { 1940 strcat(result_sz, "...OK"); 1941 } 1942 log_to_screen(result_sz); 1939 log_to_screen("%s...OK", result_sz); 1940 } 1943 1941 retval += res; 1944 1942 } -
branches/stable/mondo/src/common/libmondo-fork.c
r1119 r1138 192 192 193 193 /*@ pointers *************************************************** */ 194 FILE *fin ;195 char *p ;194 FILE *fin = NULL; 195 char *p = NULL; 196 196 197 197 /*@ end vars *************************************************** */ … … 280 280 } 281 281 } 282 // else283 // { mr_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); }284 282 return (res); 285 283 } -
branches/stable/mondo/src/lib/mr_mem.c
r1133 r1138 54 54 55 55 /* encapsulation function for getline */ 56 void mr_getline_int(char **lineptr, size_t *n, FILE * stream, int line, const char *file) {56 void mr_getline_int(char **lineptr, size_t *n, FILE *fd, int line, const char *file) { 57 57 58 58 ssize_t ret; 59 59 60 ret = getline(lineptr,n, stream);61 if ( ret == -1) {60 ret = getline(lineptr,n,fd); 61 if ((ret == -1) && (! feof(fd))) { 62 62 mr_msg_int(1,line,file,"Unable to alloc memory in mr_getline\nExiting..."); 63 63 mr_exit(-1,"Unable to alloc memory in mr_getline");
Note:
See TracChangeset
for help on using the changeset viewer.