Changeset 688 in MondoRescue for trunk/mondo/mondo/common/libmondo-filelist.c
- Timestamp:
- Jul 17, 2006, 3:44:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-filelist.c
r687 r688 847 847 { 848 848 849 /*@ structures ************************************************* */ 850 struct s_node *filelist; 851 852 /*@ pointers *************************************************** */ 853 FILE *pin; 854 855 /*@ buffers **************************************************** */ 856 char *command_to_open_fname; 849 struct s_node *filelist = NULL; 850 FILE *pin = NULL; 851 char *command_to_open_fname = NULL; 857 852 char *fname = NULL; 858 char *tmp; 859 int pos_in_fname; 853 char *tmp = NULL; 854 char *tmp1 = NULL; 855 int pos_in_fname = 0; 860 856 size_t n = 0; 861 /*@ int ******************************************************** */ 862 int percentage; 863 864 /*@ long ******************************************************* */ 865 long lines_in_filelist; 866 long lino = 0; 867 /*@ end vars *************************************************** */ 857 int percentage = 0; 858 859 long lines_in_filelist = 0L; 860 long lino = 0L; 868 861 869 862 assert_string_is_neither_NULL_nor_zerolength(filelist_fname); … … 876 869 asprintf(&tmp, "zcat %s | wc -l", filelist_fname); 877 870 log_msg(6, "tmp = %s", tmp); 878 lines_in_filelist = 879 atol(call_program_and_get_last_line_of_output(tmp)); 871 tmp1 = call_program_and_get_last_line_of_output(tmp); 880 872 paranoid_free(tmp); 873 874 lines_in_filelist = atol(tmp1); 875 paranoid_free(tmp1); 881 876 882 877 if (lines_in_filelist < 3) { … … 1322 1317 char *skeleton_filelist) 1323 1318 { 1324 DIR *dip ;1325 struct dirent *dit ;1319 DIR *dip = NULL; 1320 struct dirent *dit = NULL; 1326 1321 struct stat statbuf; 1327 char *new; 1328 char *tmp; 1322 char *new = NULL; 1323 char *tmp = NULL; 1324 char *tmp1 = NULL; 1329 1325 static int percentage = 0; 1330 char *skip_these ;1331 char *new_with_spaces ;1332 static char *name_of_evalcall_form ;1333 int i ;1326 char *skip_these = NULL; 1327 char *new_with_spaces = NULL; 1328 static char *name_of_evalcall_form = NULL; 1329 int i = 0; 1334 1330 static int depth = 0; 1335 char *p ;1331 char *p = NULL; 1336 1332 static int counter = 0; 1337 1333 static int uberctr = 0; 1338 static char *find_skeleton_marker ;1334 static char *find_skeleton_marker = NULL; 1339 1335 static long skeleton_lino = 0; 1340 1336 static time_t last_time = 0; … … 1365 1361 1366 1362 asprintf(&tmp, "wc -l %s | awk '{print $1;}'", skeleton_filelist); 1367 g_skeleton_entries = 1368 1 + atol(call_program_and_get_last_line_of_output(tmp)); 1363 tmp1 = call_program_and_get_last_line_of_output(tmp); 1369 1364 paranoid_free(tmp); 1365 1366 g_skeleton_entries = 1 + atol(tmp1); 1367 paranoid_free(tmp1); 1370 1368 1371 1369 asprintf(&name_of_evalcall_form, "Making catalog of %s", dir); … … 1534 1532 { 1535 1533 char sz_datefile_wildcard[] = "/var/cache/mondo/difflevel.%d"; 1536 char *p, *q; 1534 char *p = NULL; 1535 char *q = NULL; 1536 char *tmp = NULL; 1537 char *tmp1 = NULL; 1538 char *tmp2 = NULL; 1537 1539 char *sz_datefile; 1538 char *sz_filelist, *exclude_paths; 1539 int i; 1540 FILE *fout; 1541 char *command; 1540 char *sz_filelist = NULL; 1541 char *exclude_paths = NULL; 1542 int i = 0; 1543 FILE *fout = NULL; 1544 char *command = NULL; 1542 1545 time_t time_of_last_full_backup = 0; 1543 1546 struct stat statbuf; 1544 char *skeleton_filelist; 1547 char *skeleton_filelist = NULL; 1548 1545 1549 // The pathname to the skeleton filelist, used to give better progress reporting for mondo_makefilelist(). 1546 1547 1550 asprintf(&sz_datefile, sz_datefile_wildcard, 0); 1548 1551 if (!include_paths && !userdef_filelist) { … … 1573 1576 } 1574 1577 make_hole_for_file(sz_datefile); 1575 write_one_liner_data_file(sz_datefile,1576 call_program_and_get_last_line_of_output1577 ("date +%s"));1578 tmp = call_program_and_get_last_line_of_output("date +%s"); 1579 write_one_liner_data_file(sz_datefile, tmp); 1580 paranoid_free(tmp); 1578 1581 } else if (lstat(sz_datefile, &statbuf)) { 1579 1582 log_msg(2, … … 1600 1603 log_msg(2, "include_paths = '%s'", include_paths); 1601 1604 log_msg(1, "Calculating filelist"); 1605 tmp = call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"); 1606 tmp1 = call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"); 1607 tmp2 = call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"); 1602 1608 asprintf(&exclude_paths, " %s %s %s %s %s %s . .. \ 1603 1609 " MNT_CDROM " " MNT_FLOPPY " /media/cdrom /media/cdrecorder \ 1604 /proc /sys /tmp /var/cache/mondo /var/cache/mindi", excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir); 1610 /proc /sys /tmp /var/cache/mondo /var/cache/mindi", excp, tmp, tmp1, tmp2, (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir); 1611 paranoid_free(tmp); 1612 paranoid_free(tmp1); 1613 paranoid_free(tmp2); 1605 1614 1606 1615 log_msg(2, "Excluding paths = '%s'", exclude_paths);
Note:
See TracChangeset
for help on using the changeset viewer.