Changeset 3903 in MondoRescue for branches/3.3/mondo/src
- Timestamp:
- Dec 17, 2024, 11:42:58 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/libmondo-devices.c
r3893 r3903 1136 1136 1137 1137 /*@ int's ****************************************************** */ 1138 bool res ;1138 bool res = FALSE; 1139 1139 1140 1140 /*@ end vars **************************************************** */ … … 1151 1151 } 1152 1152 1153 if ((bkpinfo->media_device == NULL) || ( res = mount_media(mountpoint))) {1153 if ((bkpinfo->media_device == NULL) || ((res = mount_media(mountpoint)) == FALSE)) { 1154 1154 mr_free(bkpinfo->media_device); 1155 1155 if ((bkpinfo->media_device = mr_popup_and_get_string("CD-ROM device", "Please enter your CD-ROM's /dev device", "/dev/cdrom")) == NULL) { 1156 res = TRUE;1156 res = FALSE; 1157 1157 } else { 1158 1158 res = mount_media(mountpoint); 1159 1159 } 1160 1160 } 1161 if ( res) {1161 if (!res) { 1162 1162 log_msg(1, "mount failed"); 1163 1163 } else { … … 1535 1535 char *mountdev = NULL; 1536 1536 char *tmp = NULL; 1537 bool res = FALSE; 1537 1538 1538 1539 assert(bkpinfo != NULL); … … 1544 1545 cd_number = atoi(last_line_of_file(mountdev)); 1545 1546 mr_free(mountdev); 1546 return 1547 return(cd_number); 1547 1548 } 1548 1549 … … 1556 1557 } 1557 1558 if (!is_this_device_mounted(MNT_CDROM)) { 1558 mount_media(MNT_CDROM); 1559 } 1560 1561 cd_number = atoi(last_line_of_file(MNT_CDROM "/archives/THIS-CD-NUMBER")); 1559 res = mount_media(MNT_CDROM); 1560 } 1561 1562 if (res) { 1563 cd_number = atoi(last_line_of_file(MNT_CDROM "/archives/THIS-CD-NUMBER")); 1564 } else { 1565 cd_number = 0; 1566 } 1562 1567 return(cd_number); 1563 1568 } … … 1577 1582 * @param cd_number_i_want The CD number to ask for. 1578 1583 */ 1579 void 1580 insist_on_this_cd_number(int cd_number_i_want) 1581 { 1584 void insist_on_this_cd_number(int cd_number_i_want) { 1582 1585 1583 1586 /*@ int ************************************************************* */ 1584 1587 int res = 0; 1588 bool res1 = FALSE; 1585 1589 1586 1590 … … 1596 1600 1597 1601 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 1598 log_msg(3, 1599 "No need to insist_on_this_cd_number when the backup type isn't CD-R(W) or NFS or ISO"); 1602 log_msg(3, "No need to insist_on_this_cd_number when the backup type isn't CD-R(W) or NFS or ISO"); 1600 1603 return; 1601 }1602 if (!does_file_exist(MNT_CDROM)) {1603 mr_asprintf(tmp, "mkdir -p " MNT_CDROM);1604 run_program_and_log_output(tmp, 5);1605 mr_free(tmp);1606 1604 } 1607 1605 … … 1611 1609 if ((res = what_number_cd_is_this()) != cd_number_i_want) { 1612 1610 log_msg(3, "Currently, we hold %d but we want %d", res, cd_number_i_want); 1613 1614 /* Now we need to umount the current media to have the next mounted after */1615 run_program_and_log_output("umount -d " MNT_CDROM, FALSE);1616 log_msg(3, "Mounting next media %d",cd_number_i_want);1617 1611 g_current_media_number = cd_number_i_want; 1618 mount_media(MNT_CDROM);1619 1612 1620 1613 mds = media_descriptor_string(bkpinfo->backup_media_type); 1621 log_msg(3, "Insisting on %s #%d", mds, cd_number_i_want);1622 1614 mr_asprintf(request, "Please insert %s #%d and press Enter.", mds, cd_number_i_want); 1623 1615 mr_free(mds); 1624 1616 1617 // what_number_cd_is_this mounts the device anyhow if not yet done. 1618 log_msg(3, "Mounting next media %d",cd_number_i_want); 1625 1619 while (what_number_cd_is_this() != cd_number_i_want) { 1626 1620 sync(); 1627 1621 if (is_this_device_mounted(MNT_CDROM)) { 1628 res =1629 1622 /* Now we need to umount the current media to have the next mounted after */ 1623 res = run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 1630 1624 } else { 1631 1625 res = 0;
Note:
See TracChangeset
for help on using the changeset viewer.