]> git.pld-linux.org Git - packages/util-linux.git/blob - util-linux-procpartitions.patch
fix wipefs not understanding -f option
[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-ng-2.17.2/fdisks/fdisk.c.orig    2010-03-22 09:21:34.000000000 +0100
26 +++ util-linux-ng-2.17.2/fdisks/fdisk.c 2010-05-09 12:31:53.050933394 +0200
27 @@ -2844,12 +2844,14 @@
28         char line[128], ptname[128], devname[256];
29         int ma, mi;
30         unsigned long long sz;
31 +       char iobuf[32*1024];
32  
33         procpt = fopen(_PATH_PROC_PARTITIONS, "r");
34         if (procpt == NULL) {
35                 fprintf(stderr, _("cannot open %s\n"), _PATH_PROC_PARTITIONS);
36                 return;
37         }
38 +       setvbuf(procpt, iobuf, _IOFBF, sizeof(iobuf));
39  
40         while (fgets(line, sizeof(line), procpt)) {
41                 if (sscanf (line, " %d %d %llu %128[^\n ]",
This page took 0.039974 seconds and 3 git commands to generate.