Changeset 2321 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-devices.c
- Timestamp:
- Aug 18, 2009, 2:37:55 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2320 r2321 42 42 extern char *MONDO_LOGFILE; 43 43 44 extern void setup_tmpdir(char *path);45 46 44 static char g_cdrw_drive_is_here[MAX_STR_LEN / 4] = ""; 47 45 static char g_cdrom_drive_is_here[MAX_STR_LEN / 4] = ""; … … 111 109 bool is_this_a_ramdisk = FALSE; 112 110 113 malloc_string(comment);114 111 mr_asprintf(&tmp, "%s", where_is_root_mounted()); 115 mr_asprintf(&comment, "root is mounted at %s\n", tmp);112 mr_asprintf(&comment, "root is currently mounted at %s\n", tmp); 116 113 log_msg(0, comment); 117 114 mr_free(comment); 118 log_msg(0,119 "No, Schlomo, that doesn't mean %s is the root partition. It's just a debugging message. Relax. It's part of am_I_in_disaster_recovery_mode().",120 tmp);121 115 122 116 #ifdef __FreeBSD__ … … 138 132 if (is_this_a_ramdisk) { 139 133 if (!does_file_exist("/THIS-IS-A-RAMDISK")) { 140 log_to_screen 141 ("Using /dev/root is stupid of you but I'll forgive you."); 134 log_to_screen("Using /dev/root is stupid of you but I'll forgive you."); 142 135 is_this_a_ramdisk = FALSE; 143 136 } … … 146 139 is_this_a_ramdisk = TRUE; 147 140 } 148 log_msg(1, "Is this a ramdisk? result = % d", is_this_a_ramdisk);141 log_msg(1, "Is this a ramdisk? result = %s", (is_this_a_ramdisk) ? "TRUE" : "FALSE"); 149 142 return (is_this_a_ramdisk); 150 143 } … … 1374 1367 mr_asprintf(&tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir, bkpinfo->nfs_remote_dir, bkpinfo->prefix, cd_number_i_want); 1375 1368 if (does_file_exist(tmp)) { 1376 log_msg(1, 1377 "FIXME - hacking bkpinfo->isodir from '%s' to %s/isodir", 1378 bkpinfo->isodir, bkpinfo->tmpdir); 1369 log_msg(1, "FIXME - hacking bkpinfo->isodir from '%s' to %s/isodir", bkpinfo->isodir, bkpinfo->tmpdir); 1379 1370 sprintf(bkpinfo->isodir, "%s/isodir", bkpinfo->tmpdir); 1380 1371 } … … 1474 1465 } 1475 1466 */ 1476 log_msg(3, "media type = %s", 1477 bkptype_to_string(bkpinfo->backup_media_type)); 1478 if (archiving_to_media) { 1479 sensibly_set_tmpdir_and_scratchdir(); 1480 } 1467 log_msg(3, "media type = %s", bkptype_to_string(bkpinfo->backup_media_type)); 1481 1468 bkpinfo->cdrw_speed = (bkpinfo->backup_media_type == cdstream) ? 2 : 4; 1482 1469 bkpinfo->compression_level = … … 1971 1958 finish(1); 1972 1959 } 1973 strcpy(bkpinfo->tmpdir, p);1974 mr_free(p);1960 mr_free(bkpinfo->tmpdir); 1961 bkpinfo->tmpdir = p; 1975 1962 1976 1963 p = popup_and_get_string("Scratch directory", "Please enter your scratch directory.", bkpinfo->scratchdir); … … 2140 2127 * @ingroup utilityGroup 2141 2128 */ 2142 void sensibly_set_ tmpdir_and_scratchdir()2129 void sensibly_set_scratchdir() 2143 2130 { 2144 2131 char *tmp = NULL; 2145 2132 char *command = NULL; 2146 2133 char *sz = NULL; 2147 2148 assert(bkpinfo != NULL);2149 2134 2150 2135 #ifdef __FreeBSD__ … … 2161 2146 } 2162 2147 if (!tmp[0]) { 2163 fatal_error("I couldn't figure out the tempdir!"); 2164 } 2165 setup_tmpdir(tmp); 2166 log_it("bkpinfo->tmpdir is being set to %s", bkpinfo->tmpdir); 2167 2148 fatal_error("I couldn't figure out the scratchdir!"); 2149 } 2168 2150 mr_asprintf(&sz, "%s/mondo.scratch.%d", tmp, (int) (random() % 32768)); 2169 2151 mr_free(bkpinfo->scratchdir); … … 2171 2153 log_it("bkpinfo->scratchdir is being set to %s", bkpinfo->scratchdir); 2172 2154 2173 mr_asprintf(&command, "rm -Rf %s/ tmp.mondo.* %s/mondo.scratch.*", tmp, tmp);2155 mr_asprintf(&command, "rm -Rf %s/mondo.scratch.*", tmp); 2174 2156 mr_free(tmp); 2175 2157
Note:
See TracChangeset
for help on using the changeset viewer.