Changeset 689 in MondoRescue for trunk/mondo/mondo/common/libmondo-devices.c
- Timestamp:
- Jul 17, 2006, 7:43:58 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-devices.c
r688 r689 495 495 char *find_cdrw_device(void) 496 496 { 497 /*@ buffers ************************ */498 char * comment;499 char *tmp ;500 char *cdr_exe ;501 char *command ;502 char *cdrw_device ;497 char *comment = NULL; 498 char *tmp = NULL; 499 char *tmp1 = NULL; 500 char *cdr_exe = NULL; 501 char *command = NULL; 502 char *cdrw_device = NULL; 503 503 504 504 if (g_cdrw_drive_is_here != NULL) { … … 513 513 } 514 514 run_program_and_log_output("insmod ide-scsi", -1); 515 if (find_home_of_exe("cdrecord")) { 515 tmp = find_home_of_exe("cdrecord"); 516 if (tmp) { 516 517 asprintf(&cdr_exe, "cdrecord"); 517 518 } else { 518 519 asprintf(&cdr_exe, "dvdrecord"); 519 520 } 520 if (find_home_of_exe(cdr_exe)) { 521 paranoid_free(tmp); 522 523 tmp1 = find_home_of_exe(cdr_exe); 524 if (tmp1) { 521 525 asprintf(&command, 522 526 "%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", … … 527 531 asprintf(&tmp, " "); 528 532 } 533 paranoid_free(tmp1); 529 534 paranoid_free(cdr_exe); 530 535 … … 594 599 } 595 600 596 if (find_home_of_exe("cdrecord")) { 601 tmp = find_home_of_exe("cdrecord"); 602 if (tmp) { 597 603 asprintf(&cdr_exe, "cdrecord"); 598 604 } else { 599 605 asprintf(&cdr_exe, "dvdrecord"); 600 606 } 601 if (!find_home_of_exe(cdr_exe)) { 607 paranoid_free(tmp); 608 609 tmp = find_home_of_exe(cdr_exe); 610 if (!tmp) { 602 611 asprintf(&output, "/dev/cdrom"); 603 612 log_msg(4, "Can't find cdrecord; assuming %s", output); … … 612 621 } 613 622 } 623 paranoid_free(tmp); 614 624 615 625 asprintf(&command, "%s -scanbus 2> /dev/null", cdr_exe);
Note:
See TracChangeset
for help on using the changeset viewer.