while (fgets(line, sizeof(line), procpt)) {
if (sscanf (line, " %d %d %d %[^\n ]",
---- util-linux-ng-2.17.2/fdisks/fdisk.c.orig 2010-03-22 09:21:34.000000000 +0100
-+++ util-linux-ng-2.17.2/fdisks/fdisk.c 2010-05-09 12:31:53.050933394 +0200
-@@ -2844,12 +2844,14 @@
- char line[128], ptname[128], devname[256];
- int ma, mi;
- unsigned long long sz;
-+ char iobuf[32*1024];
+--- util-linux-2.26/disk-utils/fdisk-list.c.orig 2015-02-10 10:49:46.346584245 +0100
++++ util-linux-2.26/disk-utils/fdisk-list.c 2015-02-23 21:04:01.522730338 +0100
+@@ -198,6 +198,7 @@
+ char *next_proc_partition(FILE **f)
+ {
+ char line[128 + 1];
++ static char iobuf[32*1024];
- procpt = fopen(_PATH_PROC_PARTITIONS, "r");
- if (procpt == NULL) {
- fprintf(stderr, _("cannot open %s\n"), _PATH_PROC_PARTITIONS);
- return;
+ if (!*f) {
+ *f = fopen(_PATH_PROC_PARTITIONS, "r");
+@@ -205,6 +206,7 @@
+ warn(_("cannot open %s"), _PATH_PROC_PARTITIONS);
+ return NULL;
+ }
++ setvbuf(*f, iobuf, _IOFBF, sizeof(iobuf));
}
-+ setvbuf(procpt, iobuf, _IOFBF, sizeof(iobuf));
- while (fgets(line, sizeof(line), procpt)) {
- if (sscanf (line, " %d %d %llu %128[^\n ]",
+ while (fgets(line, sizeof(line), *f)) {