summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Dominic P. Guana <guana.histark@gmail.com>2021-09-15 16:00:56 +0000
committerRobert Roth <robert.roth.off@gmail.com>2022-03-28 04:55:26 +0000
commit48ad21d3293148034e11c3b85b23733b7cc708c6 (patch)
treeec49aa51cfc77ab141d2843b24c9ab48f29a5420
parente48d1a9c384c6d5c46cf8e09b8c4117bf8b303a9 (diff)
downloadlibgtop-48ad21d3293148034e11c3b85b23733b7cc708c6.tar.gz
Skip loop and rom
-rw-r--r--sysdeps/linux/disk.c32
1 files 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;