0.85/sources/installer/device.c ./sources/installer/device.c 
--- ../tmp-orig/chos-0.85/sources/installer/device.c 2005-09-02 14:28:39.000000000 +0000 
+++ ./sources/installer/device.c 2005-09-02 14:28:32.000000000 +0000 
@@ -12,6 +12,7 @@ 
#include<sys/types.h> 
#include<sys/stat.h> 
#include<sys/ioctl.h> 
+#include<sys/sysmacros.h> 
#include<unistd.h> 
#include<fcntl.h> 
#include<errno.h> 
@@ -47,9 +48,9 @@ 
// Find devices which have the same major 
sprintf(tmpstr,"%s/%s",dirname,dir->d_name); 
if( stat(tmpstr,&st)>=0 ){ 
- if( S_ISBLK(st.st_mode) && MAJOR(st.st_rdev)==lmaj && 
- (MINOR(st.st_rdev) & (incr-1)) == 0){ 
- this=MINOR(st.st_rdev)/incr+1; 
+ if( S_ISBLK(st.st_mode) && major(st.st_rdev)==lmaj && 
+ (minor(st.st_rdev) & (incr-1)) == 0){ 
+ this=minor(st.st_rdev)/incr+1; 
if(this>max){ 
/* Can we read it ?*/ 
if( (fd=open(tmpstr,O_RDWR))>=0){ 
@@ -102,19 +103,19 @@ 
if(!S_ISBLK(st.st_mode)) 
die(ENOTBLK,name); 

- switch(MAJOR(st.st_rdev)){ 
+ switch(major(st.st_rdev)){ 
case MAJOR_FD: 
- if(MINOR(st.st_rdev)>3) 
+ if(minor(st.st_rdev)>3) 
cfgerror("%s: Please use fd[0-3]\n",name); 
break; 
case MAJOR_HD: 
case MAJOR_IDE2: 
case MAJOR_XT: 
- if(MINOR(st.st_rdev)&63) 
+ if(minor(st.st_rdev)&63) 
cfgerror("%s: Please use hd[a-d]\n",name); 
break; 
case MAJOR_SD: 
- if(MINOR(st.st_rdev)&15) 
+ if(minor(st.st_rdev)&15) 
cfgerror("%s: Please use sd[a-g]\n",name); 
break; 
default: 
@@ -137,8 +138,8 @@ 

if(!ndrivemaps) 
return 0xff; 
- minor=MINOR(dev); 
- switch(MAJOR(dev)){ 
+ minor=minor(dev); 
+ switch(major(dev)){ 
case MAJOR_FD: 
minor&=3; 
break; 
@@ -153,7 +154,7 @@ 
default: 
return 0xff; 
} 
- dev=MKDEV(MAJOR(dev),minor); 
+ dev=makedev(major(dev),minor); 
for(i=0;i<ndrivemaps;i++){ 
if(drivemaps[i].dev==dev) 
return drivemaps[i].bios; 
@@ -196,7 +197,7 @@ 
biosdrive_set=1; 
//verbose("Remapped 0x%02x\n",geo->device); 
} 
- switch(MAJOR(device)){ 
+ switch(major(device)){ 
case MAJOR_FD: 
if(ioctl(fd,FDGETPRM,&fdgeo)<0) 
die(errno,dev_name(device)); 
@@ -205,7 +206,7 @@ 
geo->sectors=fdgeo.sect; 
geo->start=0; 
if(!biosdrive_set) 
- geo->device=MINOR(device)&3; 
+ geo->device=minor(device)&3; 
break; 

case MAJOR_XT: 
@@ -233,10 +234,10 @@ 
die(-1,"Invalid harddisk geometry gotten\n"); 

if(!biosdrive_set){ 
- if(MAJOR(device)==MAJOR_SD) 
- geo->device=0x80+(MINOR(device)>>4)+hdadd; 
+ if(major(device)==MAJOR_SD) 
+ geo->device=0x80+(minor(device)>>4)+hdadd; 
else 
- geo->device=0x80+(MINOR(device)>>6)+hdadd; 
+ geo->device=0x80+(minor(device)>>6)+hdadd; 
} 
break; 

@@ -271,7 +272,7 @@ 
} 

die(-1,"(%02x:%02x):No such device in "DEVPATH" !!!\n", 
- MAJOR(device),MINOR(device)); 
+ major(device),minor(device)); 
return 0; 
} 
