Changeset 2331 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-devices.c
- Timestamp:
- Aug 18, 2009, 3:25:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2330 r2331 509 509 /*@ buffers ************************ */ 510 510 char *tmp = NULL; 511 char *tmp1 = NULL; 511 512 char *cdr_exe = NULL; 512 513 char *command = NULL; … … 523 524 } 524 525 run_program_and_log_output("insmod ide-scsi", -1); 525 if (find_home_of_exe("cdrecord")) { 526 tmp = find_home_of_exe("cdrecord"); 527 if (tmp) { 526 528 mr_asprintf(cdr_exe, "cdrecord"); 527 529 } else { 528 530 mr_asprintf(cdr_exe, "dvdrecord"); 529 531 } 530 if (find_home_of_exe(cdr_exe)) { 532 mr_free(tmp); 533 534 tmp1 = find_home_of_exe(cdr_exe); 535 if (tmp1) { 531 536 mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep CD | cut -d' ' -f2 | head -n1", cdr_exe); 532 537 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command)); 533 538 mr_free(command); 534 539 } 540 mr_free(tmp1); 541 535 542 if ((tmp == NULL) || (strlen(tmp) < 2)) { 536 543 mr_free(tmp); … … 603 610 make_hole_for_dir(mountpoint); 604 611 605 if (find_home_of_exe("cdrecord")) { 612 tmp = find_home_of_exe("cdrecord"); 613 if (tmp) { 606 614 mr_asprintf(cdr_exe, "cdrecord"); 607 615 } else { 608 616 mr_asprintf(cdr_exe, "dvdrecord"); 609 617 } 610 611 if (!find_home_of_exe(cdr_exe)) { 618 mr_free(tmp); 619 620 tmp = find_home_of_exe(cdr_exe); 621 if (!tmp) { 612 622 mr_asprintf(output, "/dev/cdrom"); 613 623 log_msg(4, "Can't find cdrecord; assuming %s", output); … … 616 626 log_msg(4, "That didn't work. Sorry."); 617 627 mr_free(output); 618 return(output);619 } else {620 621 622 }628 } 629 mr_free(tmp); 630 return(output); 631 } 632 mr_free(tmp); 623 633 624 634 mr_asprintf(command, "%s -scanbus 2> /dev/null", cdr_exe); … … 992 1002 retval = 0; 993 1003 } else { 994 mr_getline( &good_formats, pin);1004 mr_getline(good_formats, pin); 995 1005 if (pclose(pin)) { 996 1006 log_OS_error("Cannot pclose good formats"); … … 2344 2354 if (does_string_exist_in_boot_block(current_drive, "GRUB")) { 2345 2355 count_grubs++; 2356 /* BERLIOS : removed as I don't think it's mandatory here 2346 2357 mr_free(which_device); 2347 2358 mr_asprintf(which_device, "%s", current_drive); 2359 */ 2348 2360 break; 2349 2361 } 2350 2362 if (does_string_exist_in_boot_block(current_drive, "LILO")) { 2351 2363 count_lilos++; 2364 /* BERLIOS : removed as I don't think it's mandatory here 2352 2365 mr_free(which_device); 2353 2366 mr_asprintf(which_device, "%s", current_drive); 2367 */ 2354 2368 break; 2355 2369 } … … 2388 2402 if (does_string_exist_in_boot_block(current_drive, "GRUB")) { 2389 2403 count_grubs++; 2404 /* BERLIOS : removed as I don't think it's mandatory here 2390 2405 mr_free(which_device); 2391 2406 mr_asprintf(which_device, "%s", current_drive); 2407 */ 2392 2408 break; 2393 2409 } 2394 2410 if (does_string_exist_in_boot_block(current_drive, "LILO")) { 2395 2411 count_lilos++; 2412 /* BERLIOS : removed as I don't think it's mandatory here 2396 2413 mr_free(which_device); 2397 2414 mr_asprintf(which_device, "%s", current_drive); 2415 */ 2398 2416 break; 2399 2417 }
Note:
See TracChangeset
for help on using the changeset viewer.