File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -395,6 +395,13 @@ pub fn connect_to_ceph(user_id: &str, config_file: &str) -> RadosResult<Rados> {
395
395
if ret_code < 0 {
396
396
return Err ( ret_code. into ( ) ) ;
397
397
}
398
+ // Instantiate Rados struct to call shutdown on drop.
399
+ // Doc specifies that it's not necessary to call rados_shutdown if
400
+ // rados_connect hasn't run, but that seems incorrect.
401
+ let rados = Rados {
402
+ rados : cluster_handle,
403
+ phantom : PhantomData ,
404
+ } ;
398
405
let ret_code = rados_conf_read_file ( cluster_handle, conf_file. as_ptr ( ) ) ;
399
406
if ret_code < 0 {
400
407
return Err ( ret_code. into ( ) ) ;
@@ -403,10 +410,7 @@ pub fn connect_to_ceph(user_id: &str, config_file: &str) -> RadosResult<Rados> {
403
410
if ret_code < 0 {
404
411
return Err ( ret_code. into ( ) ) ;
405
412
}
406
- Ok ( Rados {
407
- rados : cluster_handle,
408
- phantom : PhantomData ,
409
- } )
413
+ Ok ( rados)
410
414
}
411
415
}
412
416
You can’t perform that action at this time.
0 commit comments