| 41 | #define INTER_DISK_X 0 |
| 42 | #define INTER_DISK_Y 7 |
| 43 | int write_MBR_code(disk_t *disk_car) |
| 44 | { |
| 45 | aff_copy(stdscr); |
| 46 | wmove(stdscr,5,0); |
| 47 | wprintw(stdscr,"%s\n",disk_car->description(disk_car)); |
| 48 | wmove(stdscr,INTER_DISK_Y,INTER_DISK_X); |
| 49 | if(disk_car->arch->write_MBR_code==NULL) |
| 50 | { |
| 51 | display_message("Function to write a new MBR code not implemented for this partition type.\n"); |
| 52 | return 1; |
| 53 | } |
| 54 | wprintw(stdscr,msg_WRITE_MBR_CODE); |
| 55 | if(ask_YN(stdscr)!=0 && ask_confirmation("Write a new copy of MBR code, confirm ? (Y/N)")!=0) |
| 56 | { |
| 57 | if(disk_car->arch->write_MBR_code(disk_car)) |
| 58 | { |
| 59 | display_message("Write error: Can't write new MBR code.\n"); |
| 60 | return 2; |
| 61 | } |
| 62 | else |
| 63 | display_message("A new copy of MBR code has been written.\nYou have to reboot for the change to take effect.\n"); |
| 64 | } |
| 65 | return 0; |
| 66 | } |
| 67 | #else |
| 68 | int write_MBR_code(disk_t *disk_car) |
| 69 | { |
no test coverage detected