File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -298,13 +298,21 @@ fn unpack_without_first_dir<'a, R: Read>(
298298 . entries ( )
299299 . chain_err ( || ErrorKind :: ExtractingPackage ) ?;
300300 const MAX_FILE_SIZE : u64 = 220_000_000 ;
301- let effective_max_ram = match effective_limits:: memory_limit ( ) {
302- Ok ( ram) => Some ( ram as usize ) ,
303- Err ( e) => {
304- if let Some ( h) = notify_handler {
305- h ( Notification :: Error ( e. to_string ( ) ) )
301+ let effective_max_ram = {
302+ cfg_if:: cfg_if! {
303+ if #[ cfg( not( any( target_os="freebsd" , target_os="netbsd" ) ) ) ] {
304+ match effective_limits:: memory_limit( ) {
305+ Ok ( ram) => Some ( ram as usize ) ,
306+ Err ( e) => {
307+ if let Some ( h) = notify_handler {
308+ h( Notification :: Error ( e. to_string( ) ) )
309+ }
310+ None
311+ }
312+ }
313+ } else {
314+ None
306315 }
307- None
308316 }
309317 } ;
310318 let mut budget = MemoryBudget :: new ( MAX_FILE_SIZE as usize , effective_max_ram, notify_handler) ;
You can’t perform that action at this time.
0 commit comments