Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!elroy.jpl.nasa.gov!swrinde!mips!atha!aunro!alberta!herald.usask.ca!tisle!edwards@herald From: edwards@tisle.uucp (Colten Edwards) Newsgroups: comp.os.minix Subject: Recent format program patch Keywords: format patch Message-ID: <910613137@tisle.uucp> Date: 14 Jun 91 04:31:38 GMT Organization: Tisle Minix Center Lines: 74 In the recently posted format program, a couple of small things are needed to be patched. I run estdio v2.1 so streams are not automtically flushed. Therefore either a \n or a fflush(stdout) is needed to print the message Are you sure.. Also, probably because of a small bug in bcc/386, a couple of extra brackets are needed in order to select the right media count (??). Otherwise a disk of size 34k is created in place of a 1.2m disk. Anyways here follows a small patch ... I hope I diffed the programs in the right order. (diff -c oldfile newfile) Colten Edwards ------------------------cut here ------------------------ *** format.c Thu Jun 13 22:24:29 1991 --- format.new.c Thu Jun 13 22:21:44 1991 *************** *** 218,224 **** * usize 1200 . . 2 . * usize 1440 . . . 7 */ ! int dtype_map[4][4] = {1, 3, 5, 3, -1, 4, 6, 4, -1, -1, 2, -1, -1, -1, -1, 7}; char *progname, *nname; int interrupt = FALSE; /* If sigint or sigquit occurs */ --- 218,227 ---- * usize 1200 . . 2 . * usize 1440 . . . 7 */ ! int dtype_map[4][4] = { 1, 3, 5, 3, ! -1, 4, 6, 4, ! -1, -1, 2, -1, ! -1, -1, -1, 7}; char *progname, *nname; int interrupt = FALSE; /* If sigint or sigquit occurs */ *************** *** 452,460 **** non_boot[0x0D] = sec_cluster[dtype]; /* sec/cluster */ non_boot[0x11] = dir_size[dtype]; non_boot[0x13] = ! (unsigned char) (msize * (BLOCK_SIZE / SEC_SIZE)) % 256; ! non_boot[0x14] = ! (unsigned char) (msize * (BLOCK_SIZE / SEC_SIZE)) / 256; non_boot[0x15] = media_id[dtype]; /* media id. */ non_boot[0x16] = sec_fat[dtype]; /* sec/fat */ non_boot[0x18] = sector_table[dtype]; /* sec/cyl */ --- 455,463 ---- non_boot[0x0D] = sec_cluster[dtype]; /* sec/cluster */ non_boot[0x11] = dir_size[dtype]; non_boot[0x13] = ! (unsigned char) ((msize * (BLOCK_SIZE / SEC_SIZE)) % 256); ! non_boot[0x14] = ! (unsigned char) ((msize * (BLOCK_SIZE / SEC_SIZE)) / 256); non_boot[0x15] = media_id[dtype]; /* media id. */ non_boot[0x16] = sec_fat[dtype]; /* sec/fat */ non_boot[0x18] = sector_table[dtype]; /* sec/cyl */ *************** *** 855,860 **** --- 858,864 ---- if (interactive || !q_flag) { printf("Are you sure (y/n) ? "); + fflush(stdout); fgets(answer, 3, stdin); if (answer[0] != 'y') { unlink(nname); *************** *** 878,883 **** --- 882,888 ---- if (interactive || !q_flag) { printf("\nAnother %s%d Kb on drive %d (y/n) ? ", dos_type ?