Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com> --- cr-ensure-disk-space | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space index 6f129bd..af8efe6 100755 --- a/cr-ensure-disk-space +++ b/cr-ensure-disk-space @@ -71,11 +71,13 @@ for (;;) { last if $space >= $c{LogsMinSpaceMby}; if (!@flights) { - opendir D, "." or die $!; - $!=0; - @flights = sort { $b <=> $a } grep { m/^\d+$/ } readdir D; - die if $!; - closedir D or die $!; + open P, "-|", ontarget "ls -1 $pubdir" or die $!; + while (<P>) { + next unless m/^(\d+)\n$/; + push @flights, $1; + } + $!=$?=0; close P or die "ls: $? $!"; + @flights = sort { $b <=> $a } @flights; printf "(%d flights) ", scalar @flights; die unless @flights; } -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel