]> git.pld-linux.org Git - packages/util-linux.git/blame - util-linux-procpartitions.patch
dir attribute for dirs
[packages/util-linux.git] / util-linux-procpartitions.patch
CommitLineData
f212f39a 1Mount has to read /proc/partitions in one gulp. It doesn't. Failed for me
2after a hard powerdown (oops) and the resulting fsck-the-world frenzy on
3startup, before the mount -a. Failure cause is identical (getting out of
4sync with the text at the 1K boundary), but failure mode not quite so
5drastic as it doesn't bail out like fsck does.
6
7--- util-linux-2.11y/disk-utils/blockdev.c.procpartitions 2002-03-08 17:57:02.000000000 -0500
8+++ util-linux-2.11y/disk-utils/blockdev.c 2003-01-13 14:28:41.000000000 -0500
9@@ -290,6 +290,7 @@
10 char ptname[200];
11 char device[210];
12 int ma, mi, sz;
13+ char iobuf[32*1024];
14
15 procpt = fopen(PROC_PARTITIONS, "r");
16 if (!procpt) {
17@@ -297,6 +298,7 @@
18 progname, PROC_PARTITIONS);
19 exit(1);
20 }
21+ setvbuf(procpt, iobuf, _IOFBF, sizeof(iobuf));
22
23 while (fgets(line, sizeof(line), procpt)) {
24 if (sscanf (line, " %d %d %d %[^\n ]",
c7c0c6cb
JB
25--- util-linux-2.26/disk-utils/fdisk-list.c.orig 2015-02-10 10:49:46.346584245 +0100
26+++ util-linux-2.26/disk-utils/fdisk-list.c 2015-02-23 21:04:01.522730338 +0100
27@@ -198,6 +198,7 @@
28 char *next_proc_partition(FILE **f)
971f9098 29 {
971f9098 30 char line[128 + 1];
c7c0c6cb 31+ static char iobuf[32*1024];
971f9098 32
c7c0c6cb
JB
33 if (!*f) {
34 *f = fopen(_PATH_PROC_PARTITIONS, "r");
35@@ -205,6 +206,7 @@
36 warn(_("cannot open %s"), _PATH_PROC_PARTITIONS);
37 return NULL;
38 }
39+ setvbuf(*f, iobuf, _IOFBF, sizeof(iobuf));
40 }
971f9098 41
c7c0c6cb 42 while (fgets(line, sizeof(line), *f)) {
This page took 0.09171 seconds and 4 git commands to generate.