Merge pull request #1444 from ZoneMinder/handle_disk_free_space_error
handle disk_free_space error
This commit is contained in:
commit
513d1568d0
|
@ -1676,7 +1676,11 @@ function getDiskPercent()
|
||||||
Error("disk_total_space returned false for " . ZM_DIR_EVENTS );
|
Error("disk_total_space returned false for " . ZM_DIR_EVENTS );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$space = round(($total - disk_free_space(ZM_DIR_EVENTS)) / $total * 100);
|
$free = disk_free_space(ZM_DIR_EVENTS);
|
||||||
|
if ( ! $free ) {
|
||||||
|
Error("disk_free_space returned false for " . ZM_DIR_EVENTS );
|
||||||
|
}
|
||||||
|
$space = round(($total - $free) / $total * 100);
|
||||||
return( $space );
|
return( $space );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue