Changeset 1157 in MondoRescue
- Timestamp:
- Feb 13, 2007, 2:18:42 AM (18 years ago)
- Location:
- branches/stable/mondo/src/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/libmondo-fifo.c
r1123 r1157 159 159 void kill_buffer() 160 160 { 161 char *tmp; 162 char *command; 163 164 malloc_string(tmp); 161 char *tmp = NULL; 162 char *command = NULL; 163 165 164 sync(); 166 165 if (g_sz_call_to_buffer == NULL) { … … 173 172 "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer); 174 173 mr_msg(2, "kill_buffer() --- command = %s", command); 175 strcpy(tmp, call_program_and_get_last_line_of_output(command));174 mr_asprintf(&tmp, call_program_and_get_last_line_of_output(command)); 176 175 mr_free(command); 177 176 -
branches/stable/mondo/src/common/libmondo-filelist.c
r1123 r1157 36 36 37 37 38 extern ssize_t getline(char **lineptr, size_t * n, FILE * stream);39 40 41 38 int mondo_makefilelist(char *logfile, char *tmpdir, char *scratchdir, 42 39 char *include_paths, char *excp, int differential, … … 227 224 /*@ structures ********************************* */ 228 225 struct stat buf; 229 int err = 0;230 231 226 232 227 assert_string_is_neither_NULL_nor_zerolength(filelist); … … 253 248 if (!(fbig = fopen(biggie_fname, "w"))) { 254 249 log_OS_error("Cannot openout biggie_fname"); 255 err++; 256 goto end_of_func; 250 return (0); 257 251 } 258 252 if (!(fout = fopen(outfname, "w"))) { 259 253 log_OS_error("Cannot openout outfname"); 260 err++; 261 goto end_of_func; 254 return (0); 262 255 } 263 256 mr_getline(&incoming, &n, fin); … … 296 289 if (!(fout = fopen(outfname, "w"))) { 297 290 log_OS_error("Unable to openout outfname"); 298 err++; 299 goto end_of_func; 291 return (0); 300 292 } 301 293 update_evalcall_form((int) (lino * 100 / noof_lines)); … … 323 315 log_OS_error 324 316 ("Unable to echo write one-liner to LAST-FILELIST-NUMBER"); 325 err = 1;317 return (0); 326 318 } 327 319 mr_free(outfname); … … 340 332 then update_progress_form() won't show the "time taken / time remaining" 341 333 line. The bug only crops up AFTER the call to chop_filelist(). Weird. */ 342 #ifndef _XWIN343 334 if (!g_text_mode) { 344 335 open_progress_form("", "", "", "", 100); … … 347 338 newtPopWindow(); 348 339 } 349 #endif 350 end_of_func: 351 return (err ? 0 : curr_set_no + 1); 340 return (curr_set_no + 1); 352 341 } 353 342 … … 1333 1322 malloc_string(name_of_evalcall_form); 1334 1323 malloc_string(find_skeleton_marker); 1335 asprintf(&find_excludes, " ");1324 mr_asprintf(&find_excludes, " "); 1336 1325 while((token = mr_strtok (sth, delims, &lastpos))) { 1337 asprintf(&strtmp,"%s", find_excludes);1326 mr_asprintf(&strtmp,"%s", find_excludes); 1338 1327 mr_free(find_excludes); 1339 asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token);1328 mr_asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token); 1340 1329 mr_free(strtmp); 1341 1330 mr_free(token); … … 1343 1332 #if linux 1344 1333 // 2.6 has /sys as a proc-type thing -- must be excluded 1345 asprintf(&strtmp,1334 mr_asprintf(&strtmp, 1346 1335 "find %s -maxdepth %d -fstype mvfs -prune -o -path /dev/shm -prune -o %s -type d -print > %s 2> /dev/null", 1347 1336 dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist); 1348 1337 #else 1349 1338 // On BSD, for example, /sys is the kernel sources -- don't exclude 1350 asprintf(&strtmp,1339 mr_asprintf(&strtmp, 1351 1340 "find %s -maxdepth %d -fstype mvfs -prune -o -path /proc -prune -o %s -type d -print > %s 2> /dev/null", 1352 1341 dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);
Note:
See TracChangeset
for help on using the changeset viewer.