summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfigurator.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-10-28 09:41:32 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-10-28 09:41:32 +0000
commitf438f4f5caf143c0c6f263e09c9702b6876b91cf (patch)
treec4195a73c64e7ed42531a8b0ca997d0fec60b544 /perl-install/Xconfigurator.pm
parentb4a722c16e9be060fac6a9e5bb14ee43ea048163 (diff)
downloaddrakx-f438f4f5caf143c0c6f263e09c9702b6876b91cf.tar
drakx-f438f4f5caf143c0c6f263e09c9702b6876b91cf.tar.gz
drakx-f438f4f5caf143c0c6f263e09c9702b6876b91cf.tar.bz2
drakx-f438f4f5caf143c0c6f263e09c9702b6876b91cf.tar.xz
drakx-f438f4f5caf143c0c6f263e09c9702b6876b91cf.zip
no_comment
Diffstat (limited to 'perl-install/Xconfigurator.pm')
-rw-r--r--perl-install/Xconfigurator.pm15
1 files changed, 5 insertions, 10 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index c7d6a7eaf..fd250fea0 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -111,17 +111,12 @@ sub readMonitorsDB {
sub rewriteInittab {
my ($runlevel) = @_;
- {
- local (*F, *G);
- open F, "$prefix/etc/inittab" or die "cannot open $prefix/etc/inittab: $!";
- open G, "> $prefix/etc/inittab-" or die "cannot write in $prefix/etc/inittab-: $!";
-
- foreach (<F>) {
- print G /^(id:)[35](:initdefault:)\s*$/ ? "$1$runlevel$2\n" : $_; # **
- }
+ local @ARGV = grep { -r $_ } "$prefix/etc/inittab" or log::l("missing inittab!!!"), return;
+ local $^I = '';
+ while (<>) {
+ s/^(id:)[35](:initdefault:)\s*$/$1$runlevel$2\n/;
+ print;
}
- unlink("$prefix/etc/inittab");
- rename("$prefix/etc/inittab-", "$prefix/etc/inittab");
}
sub keepOnlyLegalModes {