summaryrefslogtreecommitdiffstats
path: root/isys/devnodes.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-10-05 18:51:06 +0000
committerJeremy Katz <katzj@redhat.com>2004-10-05 18:51:06 +0000
commitc94bce3853cda96169185b330061eb8d23d3bca5 (patch)
tree961e7f87454fbfa3f2f89e479042cdf94be94f1a /isys/devnodes.c
parent6318a78429c954f441fd0e8d40a78c9bb91ebec2 (diff)
downloadanaconda-c94bce3853cda96169185b330061eb8d23d3bca5.tar.gz
anaconda-c94bce3853cda96169185b330061eb8d23d3bca5.tar.xz
anaconda-c94bce3853cda96169185b330061eb8d23d3bca5.zip
2004-10-05 Jeremy Katz <katzj@redhat.com>
* isys/devnodes.c: Working scsi disk nodes again (#134709)
Diffstat (limited to 'isys/devnodes.c')
-rw-r--r--isys/devnodes.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/isys/devnodes.c b/isys/devnodes.c
index 5926af409..14179df6a 100644
--- a/isys/devnodes.c
+++ b/isys/devnodes.c
@@ -81,7 +81,7 @@ static int sd_major(int major_idx) {
int devMakeInode(char * devName, char * path) {
int i;
- unsigned int major, minor;
+ int major, minor;
int type;
char *ptr;
char *dir;
@@ -93,7 +93,6 @@ int devMakeInode(char * devName, char * path) {
if (devName[0] == 's' && devName[1] == 'd') {
int drive = 0;
char *num = NULL;
- int maj;
type = S_IFBLK;
if (devName[3] && isdigit(devName[3])) {
@@ -105,17 +104,15 @@ int devMakeInode(char * devName, char * path) {
} else
drive = devName[2] - 'a';
- maj = sd_major(drive & 0xf0);
- if (maj < 0)
- return maj;
- major = maj >> 4;
+ major = sd_major((drive & 0xf0) >> 4);
+ if (major < 0)
+ return major;
minor = (drive * 16) % 256;
+ minor += (drive & 0xfff00);
if (num && num[0] && num[1])
minor += (num[0] - '0') * 10 + (num[1] - '0');
else if (num && num[0])
minor += (num[0] - '0');
- if (minor > 255)
- return -1;
} else if (devName[0] == 'm' && devName[1] == 'd') {
type = S_IFBLK;
major = 9;