summaryrefslogtreecommitdiffstats
path: root/perl-install/devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-04-17 15:42:29 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-04-17 15:42:29 +0000
commitdddfb90059117e6dde52c09e79ba0c8672942b53 (patch)
tree351bfc56411ea5e33782e579e7291ed783023b4c /perl-install/devices.pm
parente2ab672b87d900beabb21632833e2f97d475b09a (diff)
downloaddrakx-dddfb90059117e6dde52c09e79ba0c8672942b53.tar
drakx-dddfb90059117e6dde52c09e79ba0c8672942b53.tar.gz
drakx-dddfb90059117e6dde52c09e79ba0c8672942b53.tar.bz2
drakx-dddfb90059117e6dde52c09e79ba0c8672942b53.tar.xz
drakx-dddfb90059117e6dde52c09e79ba0c8672942b53.zip
no_comment
Diffstat (limited to 'perl-install/devices.pm')
-rw-r--r--perl-install/devices.pm28
1 files changed, 18 insertions, 10 deletions
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index c48bd3636..1a84d84ae 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -48,17 +48,9 @@ sub set_loop {
}
}
-sub make($) {
- local $_ = my $file = $_[0];
+sub entry {
my ($type, $major, $minor);
-
- if (m,^(.*/(?:dev|tmp))/(.*),) {
- $_ = $2;
- } else {
- -e $file or $file = "/tmp/$_";
- -e $file or $file = "/dev/$_";
- }
- -e $file and return $file; #- assume nobody takes fun at creating files named as device
+ local ($_) = @_;
if (/^sd(.)(\d{0,2})/) {
$type = c::S_IFBLK();
@@ -122,6 +114,22 @@ sub make($) {
"zero" => [ c::S_IFCHR(), 1, 5 ],
}}{$_} or die "unknown device $_" };
}
+ ($type, $major, $minor);
+}
+
+
+sub make($) {
+ local $_ = my $file = $_[0];
+
+ if (m,^(.*/(?:dev|tmp))/(.*),) {
+ $_ = $2;
+ } else {
+ -e $file or $file = "/tmp/$_";
+ -e $file or $file = "/dev/$_";
+ }
+ -e $file and return $file; #- assume nobody takes fun at creating files named as device
+
+ my ($type, $major, $minor) = entry($_);
#- make a directory for this inode if needed.
mkdir dirname($file), 0755;