File tree 3 files changed +15
-9
lines changed 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ cfg_if::cfg_if! {
35
35
target_os = "freebsd" ,
36
36
target_os = "fuchsia" ,
37
37
target_os = "haiku" ,
38
+ target_os = "hurd" ,
38
39
target_os = "ios" ,
39
40
target_os = "linux" ,
40
41
target_os = "macos" ,
@@ -231,6 +232,7 @@ cfg_if::cfg_if! {
231
232
target_os = "linux" ,
232
233
target_os = "fuchsia" ,
233
234
target_os = "freebsd" ,
235
+ target_os = "hurd" ,
234
236
target_os = "openbsd" ,
235
237
target_os = "netbsd" ,
236
238
all( target_os = "android" , feature = "dl_iterate_phdr" ) ,
Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ const DEBUG_PATH: &[u8] = b"/usr/lib/debug";
308
308
309
309
fn debug_path_exists ( ) -> bool {
310
310
cfg_if:: cfg_if! {
311
- if #[ cfg( any( target_os = "freebsd" , target_os = "linux" ) ) ] {
311
+ if #[ cfg( any( target_os = "freebsd" , target_os = "hurd" , target_os = " linux") ) ] {
312
312
use core:: sync:: atomic:: { AtomicU8 , Ordering } ;
313
313
static DEBUG_PATH_EXISTS : AtomicU8 = AtomicU8 :: new( 0 ) ;
314
314
Original file line number Diff line number Diff line change @@ -18,14 +18,18 @@ pub(super) fn native_libraries() -> Vec<Library> {
18
18
}
19
19
20
20
fn infer_current_exe ( base_addr : usize ) -> OsString {
21
- if let Ok ( entries) = super :: parse_running_mmaps:: parse_maps ( ) {
22
- let opt_path = entries
23
- . iter ( )
24
- . find ( |e| e. ip_matches ( base_addr) && e. pathname ( ) . len ( ) > 0 )
25
- . map ( |e| e. pathname ( ) )
26
- . cloned ( ) ;
27
- if let Some ( path) = opt_path {
28
- return path;
21
+ cfg_if:: cfg_if! {
22
+ if #[ cfg( not( target_os = "hurd" ) ) ] {
23
+ if let Ok ( entries) = super :: parse_running_mmaps:: parse_maps( ) {
24
+ let opt_path = entries
25
+ . iter( )
26
+ . find( |e| e. ip_matches( base_addr) && e. pathname( ) . len( ) > 0 )
27
+ . map( |e| e. pathname( ) )
28
+ . cloned( ) ;
29
+ if let Some ( path) = opt_path {
30
+ return path;
31
+ }
32
+ }
29
33
}
30
34
}
31
35
env:: current_exe ( ) . map ( |e| e. into ( ) ) . unwrap_or_default ( )
You can’t perform that action at this time.
0 commit comments