aboutsummaryrefslogtreecommitdiff
path: root/filesystems/libblkid/files/patch-libblkid_src_devname.c
blob: cf1040ef3f52a1c356d8adff29ae0dc9fec6ee5b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- libblkid/src/devname.c.orig	2025-06-24 07:55:28 UTC
+++ libblkid/src/devname.c
@@ -224,7 +224,11 @@ static void probe_one(blkid_cache cache, const char *p
 
 		if (stat(device, &st) == 0 &&
 		    (S_ISBLK(st.st_mode) ||
-		     (S_ISCHR(st.st_mode) && !strncmp(ptname, "ubi", 3))) &&
+		     (S_ISCHR(st.st_mode)
+#ifdef __linux__
+		      && !strncmp(ptname, "ubi", 3)
+#endif
+		      )) &&
 		    st.st_rdev == devno) {
 			devname = strdup(device);
 			goto get_dev;
@@ -251,8 +255,12 @@ set_pri:
 			dev->bid_pri = BLKID_PRI_DM;
 			if (is_dm_leaf(ptname))
 				dev->bid_pri += 5;
-		} else if (!strncmp(ptname, "md", 2))
-			dev->bid_pri = BLKID_PRI_MD;
+		} else {
+#ifdef __linux__
+			if (!strncmp(ptname, "md", 2))
+				dev->bid_pri = BLKID_PRI_MD;
+#endif
+		}
 		if (removable)
 			dev->bid_flags |= BLKID_BID_FL_REMOVABLE;
 	}