Changeset 783 in MondoRescue for trunk/mondo/mondo/common/libmondo-files.c
- Timestamp:
- Aug 31, 2006, 5:09:20 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-files.c
r764 r783 25 25 26 26 extern int g_currentY; 27 extern int g_noof_log_lines; 27 28 extern char *g_mondo_home; 28 29 … … 77 78 } 78 79 return (output); 79 }80 81 82 /**83 * Get a not-quite-unique representation of some of the file's @c stat properties.84 * The returned string has the form <tt>size-mtime-ctime</tt>.85 * @param curr_fname The file to generate the "checksum" for.86 * @return The "checksum".87 * @note The returned string points to static storage that will be overwritten with each call.88 */89 char *calc_file_ugly_minichecksum(char *curr_fname)90 {91 92 /*@ buffers ***************************************************** */93 char *curr_cksum;94 95 /*@ pointers **************************************************** */96 97 /*@ structures ************************************************** */98 struct stat buf;99 100 /*@************************************************************** */101 102 assert_string_is_neither_NULL_nor_zerolength(curr_fname);103 if (lstat(curr_fname, &buf)) {104 asprintf(&curr_cksum, "");105 } else {106 asprintf(&curr_cksum, "%ld-%ld-%ld", (long) (buf.st_size),107 (long) (buf.st_mtime), (long) (buf.st_ctime));108 }109 return (curr_cksum);110 80 } 111 81 … … 275 245 if (kernel == NULL) { 276 246 kernel = call_program_and_get_last_line_of_output 277 ("mindi --findkernel 2> /dev/null") );247 ("mindi --findkernel 2> /dev/null"); 278 248 } 279 249 // If we didn't get anything back, check whether mindi raised a fatal error … … 481 451 log_it(tmp); 482 452 paranoid_free(tmp); 483 asprintf(&output, ""); 484 485 return (output); 453 return (NULL); 486 454 } 487 455 asprintf(&command, "tail -n1 %s", filename); … … 1033 1001 paranoid_free(command); 1034 1002 1035 if (bkpinfo->postnuke_tarball [0]) {1003 if (bkpinfo->postnuke_tarball) { 1036 1004 asprintf(&command, "cp -f %s %s/post-nuke.tgz", 1037 1005 bkpinfo->postnuke_tarball, bkpinfo->tmpdir); … … 1187 1155 { 1188 1156 /*@ buffers *************** */ 1189 char *tmp ;1157 char *tmp = NULL; 1190 1158 1191 1159 /*@ long long ************* */ … … 1214 1182 asprintf(&tmp, 1215 1183 _("Your backup will probably occupy a single %s. Maybe two."), 1216 media_descriptor_string(bkpinfo->backup_media_type));1184 bkpinfo->backup_media_string); 1217 1185 } else { 1218 1186 asprintf(&tmp, _("Your backup will occupy approximately %s media."), 1219 1187 number_to_text((int) (scratchLL + 1))); 1220 1188 } 1221 if (!bkpinfo->image_devs [0]&& (scratchLL < 50)) {1189 if (!bkpinfo->image_devs && (scratchLL < 50)) { 1222 1190 log_to_screen(tmp); 1223 1191 } … … 1235 1203 bool is_this_file_compressed(char *filename) 1236 1204 { 1237 char *do_not_compress_these ;1238 char *tmp ;1239 char *p ;1205 char *do_not_compress_these = NULL; 1206 char *tmp = NULL; 1207 char *p = NULL; 1240 1208 1241 1209 asprintf(&tmp, "%s/do-not-compress-these", g_mondo_home);
Note:
See TracChangeset
for help on using the changeset viewer.