]>
Commit | Line | Data |
---|---|---|
5545a732 JR |
1 | - issues with raw device support ("raw0" is wrong device name) |
2 | ||
3 | --- util-linux-2.13-pre6/disk-utils/raw.c.kzak 2006-11-21 21:56:40.000000000 +0100 | |
4 | +++ util-linux-2.13-pre6/disk-utils/raw.c 2006-11-21 22:35:11.000000000 +0100 | |
5 | @@ -66,6 +66,7 @@ | |
6 | int err; | |
7 | int block_major, block_minor; | |
8 | int i; | |
9 | + int rc; | |
10 | ||
11 | struct stat statbuf; | |
12 | ||
13 | @@ -108,19 +109,23 @@ | |
14 | usage(1); | |
15 | raw_name = argv[optind++]; | |
16 | ||
17 | + rc = sscanf(raw_name, RAWDEVDIR "raw%d", &raw_minor); | |
18 | + if (rc != 1) { | |
19 | + fprintf (stderr, | |
20 | + "Unsupported raw device name '%s' (format is " RAWDEVDIR "rawN))\n", | |
21 | + raw_name); | |
22 | + exit(2); | |
23 | + } | |
24 | + if (raw_minor == 0) { | |
25 | + fprintf (stderr, | |
26 | + "Unsupported raw device name '%s' (minor number cannot be zero)\n", | |
27 | + raw_name); | |
28 | + exit(2); | |
29 | + } | |
30 | + | |
31 | err = stat(raw_name, &statbuf); | |
32 | - if (err) { | |
33 | - int rc; | |
34 | - | |
35 | - rc = sscanf(raw_name, RAWDEVDIR "raw%d", &raw_minor); | |
36 | - if (rc != 1) { | |
37 | - fprintf (stderr, | |
38 | - "Cannot locate raw device '%s' (%s)\n", | |
39 | - raw_name, strerror(errno)); | |
40 | - exit(2); | |
41 | - } | |
42 | + if (err) | |
43 | goto skip_test_rawdev; | |
44 | - } | |
45 | ||
46 | if (!S_ISCHR(statbuf.st_mode)) { | |
47 | fprintf (stderr, "raw device '%s' is not a character dev\n", |