int Xsetpid(char *args, struct disk *disk, struct mbr *mbr, struct mbr *tt, int offset) { const char *errstr; int pn, num; struct prt *pp; pn = strtonum(args, 0, 3, &errstr); if (errstr) { printf("partition number is %s: %s\n", errstr, args); return (CMD_CONT); } pp = &mbr->part[pn]; /* Print out current table entry */ PRT_print(0, NULL, NULL); PRT_print(pn, pp, NULL); /* Ask for partition type */ num = ask_pid(pp->id); if (num == pp->id) return (CMD_CONT); pp->id = num; return (CMD_DIRTY); }
/* ARGSUSED */ int Xsetpid(cmd_t *cmd, disk_t *disk, mbr_t *mbr, mbr_t *tt, int offset) { const char *errstr; int pn, num, ret; prt_t *pp; ret = CMD_CONT; pn = (int)strtonum(cmd->args, 0, 3, &errstr); if (errstr) { printf("partition number is %s: %s\n", errstr, cmd->args); return (ret); } pp = &mbr->part[pn]; /* Print out current table entry */ PRT_print(0, NULL, NULL); PRT_print(pn, pp, NULL); /* Ask for partition type */ num = ask_pid(pp->id); if (num != pp->id) ret = CMD_DIRTY; pp->id = num; return (ret); }