]> git.pld-linux.org Git - packages/util-linux.git/blob - util-linux-procpartitions.patch
- updated gettext BR
[packages/util-linux.git] / util-linux-procpartitions.patch
1 Mount has to read /proc/partitions in one gulp. It doesn't. Failed for me 
2 after a hard powerdown (oops) and the resulting fsck-the-world frenzy on 
3 startup, before the mount -a. Failure cause is identical (getting out of 
4 sync with the text at the 1K boundary), but failure mode not quite so 
5 drastic 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 ]",
25 --- util-linux-2.25/disk-utils/fdisk.c.orig     2010-03-22 09:21:34.000000000 +0100
26 +++ util-linux-2.25/disk-utils/fdisk.c  2010-05-09 12:31:53.050933394 +0200
27 @@ -343,6 +343,7 @@ static void print_all_devices_pt(struct
28  {
29         FILE *f;
30         char line[128 + 1];
31 +       char iobuf[32*1024];
32  
33         f = fopen(_PATH_PROC_PARTITIONS, "r");
34         if (!f) {
35 @@ -352,6 +353,8 @@ static void print_all_devices_pt(struct
36  
37         DBG(FRONTEND, dbgprint("reading "_PATH_PROC_PARTITIONS));
38  
39 +       setvbuf(f, iobuf, _IOFBF, sizeof(iobuf));
40 +
41         while (fgets(line, sizeof(line), f)) {
42                 char ptname[128 + 1], devname[256];
43  
44
This page took 0.026036 seconds and 3 git commands to generate.