package http; # $Id$ use IO::Socket; use network; my $sock; sub getFile { local ($^W) = 0; my ($url) = @_; $sock->close if $sock; $url =~ m|/XXX$| and return; #- force closing connection. my ($host, $port, $path) = $url =~ m,^http://([^/:]+)(?::(\d+))?(/\S*)?$,; $host = network::resolv($host); $sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port || 80, Proto => 'tcp', Timeout => 60) or die "can't connect $@"; $sock->autoflush; print $sock join("\015\012" => "GET $path HTTP/1.0", "Host: $host" . ($port && ":$port"), "User-Agent: DrakX/vivelinuxabaszindozs", "", ""); #- skip until empty line my ($now, $last, $buf, $tmp) = 0; my $read = sub { sysread($sock, $buf, 1) or die ''; $tmp .= $buf }; do { $last = $now; &$read; &$read if $buf =~ /\015/; $now = $buf =~ /\012/; } until $now && $last; $tmp =~ /^.*\b200\b/ ? $sock : undef; } 1; /mdv2007.1 Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/perl-install/resize_fat/main.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-07-09 18:48:32 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-07-09 18:48:32 +0000
commit925e58d2b3b5fc4adeefcf9f7c3062ba5efde627 (patch)
tree29aed7d1e75323231b3b4623d84ce3c59a148cb8 /perl-install/resize_fat/main.pm
parentc8b361905dedbe2961b4e3c1670d5028eec12807 (diff)
downloaddrakx-925e58d2b3b5fc4adeefcf9f7c3062ba5efde627.tar
drakx-925e58d2b3b5fc4adeefcf9f7c3062ba5efde627.tar.gz
drakx-925e58d2b3b5fc4adeefcf9f7c3062ba5efde627.tar.bz2
drakx-925e58d2b3b5fc4adeefcf9f7c3062ba5efde627.tar.xz
drakx-925e58d2b3b5fc4adeefcf9f7c3062ba5efde627.zip
*** empty log message ***
Diffstat (limited to 'perl-install/resize_fat/main.pm')
-rw-r--r--perl-install/resize_fat/main.pm7
1 files changed, 1 insertions, 6 deletions
diff --git a/perl-install/resize_fat/main.pm b/perl-install/resize_fat/main.pm
index 2d5f4f969..d9f7a2181 100644
--- a/perl-install/resize_fat/main.pm
+++ b/perl-install/resize_fat/main.pm
@@ -15,11 +15,6 @@ use resize_fat::fat;
use resize_fat::any;
-#@ARGV == 2 or die "usage: fatresize <device> <size>\n <size> = 100 means `resize to 100Mb'\n <size> = +10 means `keep 10Mb of free space'\n";
-#
-#my $fs = init($ARGV[0]);
-#resize($fs, $ARGV[1]);
-
1;
# - reads in the boot sector/partition info., and tries to make some sense of it
@@ -134,7 +129,7 @@ sub resize {
$fs->{nb_sectors} = $size;
$fs->{nb_clusters} = $new_nb_clusters;
$fs->{clusters}->{count}->{free} =
- $fs->{nb_clusters} - $fs->{clusters}->{count}->{used} - $fs->{clusters}->{count}->{bad};
+ $fs->{nb_clusters} - $fs->{clusters}->{count}->{used} - $fs->{clusters}->{count}->{bad} - 2;
$fs->{system_id} = 'was here!';
$fs->{small_nb_sectors} = 0;