Changeset 1741 in MondoRescue for branches/2.2.5/mondo/src/common/libmondo-devices.c
- Timestamp:
- Oct 30, 2007, 11:44:02 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mondo/src/common/libmondo-devices.c
r1739 r1741 1619 1619 * @return 0 for success, nonzero for failure. 1620 1620 */ 1621 int mount_USB_here(char *device, char *mountpoint) 1622 { 1623 /*@ buffer ****************************************************** */ 1624 char *command; 1625 char *dev; 1626 int retval; 1627 1628 malloc_string(command); 1629 malloc_string(dev); 1630 malloc_string(options); 1631 assert_string_is_neither_NULL_nor_zerolength(device); 1632 assert_string_is_neither_NULL_nor_zerolength(mountpoint); 1633 1634 make_hole_for_dir(mountpoint); 1635 if (isdigit(device[0])) { 1636 return(1); 1637 } else { 1638 strcpy(dev, device); 1639 } 1640 log_msg(4, "(mount_USB_here --- device=%s, mountpoint=%s", device, 1641 mountpoint); 1642 1643 #ifdef __FreeBSD__ 1644 sprintf(command, "mount_vfat %s %s 2>> %s", 1645 device, mountpoint, MONDO_LOGFILE); 1646 1647 #else 1648 sprintf(command, "mount %s -t vfat %s 2>> %s", 1649 device, options, mountpoint, MONDO_LOGFILE); 1650 #endif 1651 1652 log_msg(4, command); 1653 retval = system(command); 1654 log_msg(1, "system(%s) returned %d", command, retval); 1655 1656 paranoid_free(command); 1657 paranoid_free(dev); 1658 paranoid_free(options); 1659 return (retval); 1660 } 1661 1662 /** 1663 * Mount the CD-ROM at @p mountpoint. 1664 * @param device The device (or file if g_ISO_restore_mode) to mount. 1665 * @param mountpoint The place to mount it. 1666 * @return 0 for success, nonzero for failure. 1667 */ 1621 1668 int mount_CDROM_here(char *device, char *mountpoint) 1622 1669 { … … 2647 2694 } 2648 2695 if (!is_this_device_mounted(MNT_CDROM)) { 2649 mount_CDROM_here(mountdev, MNT_CDROM); 2696 if (bkpinfo->backup_media_type == usb) { 2697 mount_USB_here(mountdev, MNT_CDROM); 2698 } else { 2699 mount_CDROM_here(mountdev, MNT_CDROM); 2700 } 2650 2701 } 2651 2702 cd_number =
Note:
See TracChangeset
for help on using the changeset viewer.