[libgtop] Skip loop and rom



commit 48ad21d3293148034e11c3b85b23733b7cc708c6
Author: James Dominic P. Guana <guana histark gmail com>
Date:   Wed Sep 15 16:00:56 2021 +0000

    Skip loop and rom

 sysdeps/linux/disk.c | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)
---
diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c
index dbd46dff..3a8d9e09 100644
--- a/sysdeps/linux/disk.c
+++ b/sysdeps/linux/disk.c
@@ -66,7 +66,13 @@ find_primary_part (partition_info *primary_part, const char *m)
 
                if (tlvl == 0) {
 
-                       if (strcmp (type, "disk") == 0) {
+                       if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) {
+
+                               n--;
+                               tlvl = 0;
+
+                       }
+                       else if (strcmp (type, "disk") == 0) {
 
                                primary_part->max++;
 
@@ -80,7 +86,13 @@ find_primary_part (partition_info *primary_part, const char *m)
                }
                else if(tlvl == 1){
 
-                       if (strcmp (type, "disk") == 0) {
+                       if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) {
+
+                               n--;
+                               tlvl = 0;
+
+                       }
+                       else if (strcmp (type, "disk") == 0) {
 
                                n--;
                                tlvl = 0;
@@ -102,7 +114,13 @@ find_primary_part (partition_info *primary_part, const char *m)
                }
                else if( tlvl == 2){
 
-                       if (strcmp(type, "disk") == 0) {
+                       if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) {
+
+                               n--;
+                               tlvl = 0;
+
+                       }
+                       else if (strcmp(type, "disk") == 0) {
 
                                n--;
                                tlvl = 0;
@@ -132,7 +150,13 @@ find_primary_part (partition_info *primary_part, const char *m)
                }
                else if (tlvl == 3) {
 
-                       if (strcmp (type, "disk") == 0) {
+                       if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) {
+
+                               n--;
+                               tlvl = 0;
+
+                       }
+                       else if (strcmp (type, "disk") == 0) {
 
                                n--;
                                tlvl = 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]