cvsdist 67c2933
--- util-linux-2.11y/disk-utils/blockdev.c.procpartitions	2002-03-08 17:57:02.000000000 -0500
cvsdist 67c2933
+++ util-linux-2.11y/disk-utils/blockdev.c	2003-01-13 14:28:41.000000000 -0500
cvsdist 67c2933
@@ -290,6 +290,7 @@
cvsdist 67c2933
 	char ptname[200];
cvsdist 67c2933
 	char device[210];
cvsdist 67c2933
 	int ma, mi, sz;
cvsdist 67c2933
+	char iobuf[32*1024];
cvsdist 67c2933
 
cvsdist 67c2933
 	procpt = fopen(PROC_PARTITIONS, "r");
cvsdist 67c2933
 	if (!procpt) {
cvsdist 67c2933
@@ -297,6 +298,7 @@
cvsdist 67c2933
 			progname, PROC_PARTITIONS);
cvsdist 67c2933
 		exit(1);
cvsdist 67c2933
 	}
cvsdist 67c2933
+	setvbuf(procpt, iobuf, _IOFBF, sizeof(iobuf));
cvsdist 67c2933
 
cvsdist 67c2933
 	while (fgets(line, sizeof(line), procpt)) {
cvsdist 67c2933
 		if (sscanf (line, " %d %d %d %[^\n ]",
cvsdist 67c2933
--- util-linux-2.11y/fdisk/fdisk.c.procpartitions	2003-01-13 14:28:41.000000000 -0500
cvsdist 67c2933
+++ util-linux-2.11y/fdisk/fdisk.c	2003-01-13 14:28:41.000000000 -0500
cvsdist 67c2933
@@ -2371,12 +2371,14 @@
cvsdist 67c2933
 	FILE *procpt;
cvsdist 67c2933
 	char line[100], ptname[100], devname[120], *s;
cvsdist 67c2933
 	int ma, mi, sz;
cvsdist 67c2933
+	char iobuf[32*1024];
cvsdist 67c2933
 
cvsdist 67c2933
 	procpt = fopen(PROC_PARTITIONS, "r");
cvsdist 67c2933
 	if (procpt == NULL) {
cvsdist 67c2933
 		fprintf(stderr, _("cannot open %s\n"), PROC_PARTITIONS);
cvsdist 67c2933
 		return;
cvsdist 67c2933
 	}
cvsdist 67c2933
+	setvbuf(procpt, iobuf, _IOFBF, sizeof(iobuf));
cvsdist 67c2933
 
cvsdist 67c2933
 	while (fgets(line, sizeof(line), procpt)) {
cvsdist 67c2933
 		if (sscanf (line, " %d %d %d %[^\n ]",
cvsdist 67c2933
--- util-linux-2.11y/mount/mount_by_label.c.procpartitions	2002-11-26 04:23:49.000000000 -0500
cvsdist 67c2933
+++ util-linux-2.11y/mount/mount_by_label.c	2003-01-13 14:31:53.000000000 -0500
cvsdist 67c2933
@@ -136,9 +136,7 @@
cvsdist 67c2933
 	char device[110];
cvsdist 67c2933
 	int firstPass;
cvsdist 67c2933
 	int handleOnFirst;
cvsdist 67c2933
-#if 0
cvsdist 67c2933
 	char iobuf[32*1024];	/* For setvbuf */
cvsdist 67c2933
-#endif
cvsdist 67c2933
 
cvsdist 67c2933
 	if (uuidCache)
cvsdist 67c2933
 		return;
cvsdist 67c2933
@@ -155,7 +153,6 @@
cvsdist 67c2933
 		       PROC_PARTITIONS);
cvsdist 67c2933
 		return;
cvsdist 67c2933
 	}
cvsdist 67c2933
-#if 0
cvsdist 67c2933
 /* Ugly kludge - the contents of /proc/partitions change in time,
cvsdist 67c2933
    and this causes failures when the file is not read in one go.
cvsdist 67c2933
    In particular, one cannot use stdio on /proc/partitions.
cvsdist 67c2933
@@ -166,9 +163,12 @@
cvsdist 67c2933
    to keep statistics in /proc/partitions. Of course, statistics belong
cvsdist 67c2933
    in some /proc/diskstats, not in some /proc file that happened to
cvsdist 67c2933
    exist already. */
cvsdist 67c2933
-
cvsdist 67c2933
+/* Until someone actually implements something else, /proc/partitions _IS_ 
cvsdist 67c2933
+   /proc/diskstats. And no matter what file we are reading, we will still 
cvsdist 67c2933
+   need to increase the buffer size, because 8k is just not Enough For 
cvsdist 67c2933
+   Everyone even if stats aren't in /proc/partitions.
cvsdist 67c2933
+*/
cvsdist 67c2933
 	setvbuf(procpt, iobuf, _IOFBF, sizeof(iobuf));
cvsdist 67c2933
-#endif
cvsdist 67c2933
 
cvsdist 67c2933
 	for (firstPass = 1; firstPass >= 0; firstPass--) {
cvsdist 67c2933
 	    fseek(procpt, 0, SEEK_SET);