Commit f201d7bd authored by Mike Hibler's avatar Mike Hibler
Browse files

Avoid uninitialized variable.

parent 6d22c601
...@@ -1502,14 +1502,25 @@ sub check_progress($$) ...@@ -1502,14 +1502,25 @@ sub check_progress($$)
# been exceeded. # been exceeded.
# #
my $cursize = (stat($fname))[7]; my $cursize = (stat($fname))[7];
if ($usefup && !defined($cursize)) { if (!defined($cursize)) {
# #
# XXX avoid an ugly race. # XXX avoid an ugly race.
# When done, frisuploadd moves foo.tmp -> foo # When done, frisuploadd moves foo.tmp -> foo
# If we didn't find foo.tmp, try foo now. # If we didn't find foo.tmp, try foo now.
# #
$fname =~ s/\.tmp$//; if ($usefup) {
$cursize = (stat($fname))[7]; $fname =~ s/\.tmp$//;
$cursize = (stat($fname))[7];
}
#
# XXX avoid an ugly uninitialized value.
# This should not happen, since we created the file,
# but just in case, if the file doesn't exist set the size to 0.
# We will eventually timeout.
#
if (!defined($cursize)) {
$cursize = 0;
}
} }
if ($cursize > $maximagesize) { if ($cursize > $maximagesize) {
$result = "toobig"; $result = "toobig";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment