File tree 5 files changed +15
-5
lines changed
5 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ type Limits = possumC.Limits
19
19
20
20
func Open (dir string ) (handle * Handle , err error ) {
21
21
cHandle := possumC .NewHandle (dir )
22
+ if cHandle == nil {
23
+ err = errors .New ("unhandled possum error" )
24
+ return
25
+ }
22
26
generics .InitNew (& handle )
23
27
handle .cHandle .Init (cHandle , func (cHandle * possumC.Handle ) {
24
28
possumC .DropHandle (cHandle )
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ pub extern "C" fn possum_new(path: *const c_char) -> *mut PossumHandle {
29
29
let handle = match Handle :: new ( path_buf. clone ( ) ) {
30
30
Ok ( handle) => handle,
31
31
Err ( err) => {
32
- error ! ( "error creating possum handle in {path_buf:?}: {err}" ) ;
32
+ error ! ( "error creating possum handle in {path_buf:?}: {err:#? }" ) ;
33
33
return null_mut ( ) ;
34
34
}
35
35
} ;
Original file line number Diff line number Diff line change @@ -37,8 +37,14 @@ impl Dir {
37
37
let _ = std:: fs:: remove_file ( & dst_path) ;
38
38
match clone_res {
39
39
Ok ( ( ) ) => true ,
40
- Err ( err) if CloneFileError :: is_unsupported ( & err) => false ,
41
- Err ( err) => return Err ( err) . context ( "testing clonefile" ) ,
40
+ Err ( err) if CloneFileError :: is_unsupported ( & err) => {
41
+ warn ! ( ?err, "clonefile unsupported" ) ;
42
+ false
43
+ } ,
44
+ Err ( err) => {
45
+ error ! ( ?err) ;
46
+ return Err ( err) . context ( "testing clonefile" )
47
+ } ,
42
48
}
43
49
}
44
50
} ;
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ impl Handle {
103
103
"3.42"
104
104
) ;
105
105
}
106
- let dir = Dir :: new ( dir) ?;
106
+ let dir = Dir :: new ( dir) . context ( "new Dir" ) ?;
107
107
let mut conn = Connection :: open ( dir. path ( ) . join ( MANIFEST_DB_FILE_NAME ) ) ?;
108
108
Self :: init_sqlite_conn ( & mut conn, & dir) ?;
109
109
let ( deleted_values, receiver) = sync:: mpsc:: sync_channel ( 10 ) ;
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ impl CloneFileError for NativeIoError {
27
27
#[ cfg( unix) ]
28
28
fn is_unsupported ( & self ) -> bool {
29
29
self . raw_os_error ( )
30
- . map ( |errno| matches ! ( errno, EOPNOTSUPP ) )
30
+ . map ( |errno| matches ! ( errno, EOPNOTSUPP | libc :: EXDEV ) )
31
31
. unwrap_or_default ( )
32
32
}
33
33
#[ cfg( windows) ]
You can’t perform that action at this time.
0 commit comments