]> git.pld-linux.org Git - packages/util-linux.git/blobdiff - util-linux-procpartitions.patch
- updated to 2.28.2
[packages/util-linux.git] / util-linux-procpartitions.patch
index 76e5a5a85c26559b98597874714eb7c630d50491..19db66f67a3e46b5cdfa609d92b05f68d3ec4de5 100644 (file)
@@ -22,20 +22,21 @@ drastic as it doesn't bail out like fsck does.
  
        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)) {
This page took 0.227284 seconds and 4 git commands to generate.