9
# remove old nodes, create new, restore permisions
11
system("mknod ".$_[0]." c ".$_[1]." ".$_[2]);
13
chown $_[4], $_[5], $_[0];
16
# new kernel detection
17
open(fh,"</proc/version");
18
if(<fh> =~ /Linux version \d\.(\d)\.\d/) {
19
$newvers = $1 if($1 > 3);
22
err("/proc not mounted, aborting.");
26
err("Oops, please create some joystick device nodes with MAKEDEV first!") if($#nodes < 0);
28
# read modes and resolve links when needed
31
if(!defined($newvers) && ($mode[6] < 3500) ) { # old kernel, new device
33
fix($_, 15, ($mode[6] % 256), $mode[2], $mode[4], $mode[5]);
34
print "Recreating $_\n";
36
if(defined($newvers) && ($mode[6] > 3500) ) { # new kernel, old device
38
fix($_, 13, ($mode[6] % 256), $mode[2], $mode[4], $mode[5]);
39
print "Recreating $_\n";
42
if(!defined($rec)) { print "device files are okay!\n" }