File: 21_fix_testing.patch

package info (click to toggle)
dmraid 1.0.0.rc16-12
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 4,512 kB
  • sloc: ansic: 16,997; sh: 2,996; makefile: 265
file content (24 lines) | stat: -rw-r--r-- 733 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: Phillip Susi <psusi@cfl.rr.com>
Last-Update: 2011-03-08
Forwarded: yes
Description: Testing with dm devices was failing on Ubuntu because
 /dev/dm-X is the actual device node, but the code wanted it to be
 a symlink.  Fixed dm_test_device() to test that the file ( or node
 it points to ) is a block device, which seems a much more
 appropriate test.

Index: b/1.0.0.rc16/lib/device/scan.c
===================================================================
--- a/1.0.0.rc16/lib/device/scan.c
+++ b/1.0.0.rc16/lib/device/scan.c
@@ -86,8 +86,8 @@
 {
 	struct stat s;
 
-	return !lstat(path, &s) &&
-		S_ISLNK(s.st_mode) &&
+	return !stat(path, &s) &&
+		S_ISBLK(s.st_mode) &&
 		!strncmp(get_basename(lc, path), "dm-", 3);
 }